Univention Bugzilla – Attachment 7328 Details for
Bug 39664
Offer next/previous buttons in app detail view in order to browse directly to other apps
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adapted patch fpr prev and next button
39664_prevNextApp2015-12-01.patch (text/plain), 4.73 KB, created by
Alexander Kramer
on 2015-12-01 08:48:45 CET
(
hide
)
Description:
Adapted patch fpr prev and next button
Filename:
MIME Type:
Creator:
Alexander Kramer
Created:
2015-12-01 08:48:45 CET
Size:
4.73 KB
patch
obsolete
>Index: umc/js/appcenter.js >=================================================================== >--- umc/js/appcenter.js (Revision 66007) >+++ umc/js/appcenter.js (Arbeitskopie) >@@ -125,8 +125,8 @@ > > _getModuleStateAttr: function() { > var state = []; >- var _selectedWidget = lang.getObject('selectedChildWidget', false, this) >- var _app = lang.getObject('selectedChildWidget.app', false, this) >+ var _selectedWidget = lang.getObject('selectedChildWidget', false, this); >+ var _app = lang.getObject('selectedChildWidget.app', false, this); > if (_selectedWidget == this._appCenterPage) { > state = ['category', this._appCenterPage._searchSidebar.get('category')]; > } else if (_app) { >@@ -177,7 +177,7 @@ > > showApp: function(app) { > topic.publish('/umc/actions', this.moduleID, this.moduleFlavor, app.id, 'show'); >- tools.umcpCommand('appcenter/ping') >+ tools.umcpCommand('appcenter/ping'); > //this.standby(true); > var appDetailsDialog = new AppDetailsDialog({ > moduleID: this.moduleID, >@@ -208,6 +208,7 @@ > detailsDialog: appDetailsDialog, > configDialog: appConfigDialog, > hostDialog: appChooseHostDialog, >+ visibleApps: this._appCenterPage.getVisibleApps(), > udmAccessible: this.udmAccessible(), > standby: lang.hitch(this, 'standby'), > standbyDuring: lang.hitch(this, 'standbyDuring'), >Index: umc/js/appcenter/AppDetailsPage.js >=================================================================== >--- umc/js/appcenter/AppDetailsPage.js (Revision 66007) >+++ umc/js/appcenter/AppDetailsPage.js (Arbeitskopie) >@@ -110,14 +110,6 @@ > this.own(this._progressBar); > this._grid = new AppCenterGallery({}); > this.own(this._grid); >- >- this.headerButtons = [{ >- name: 'close', >- iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite', >- label: this.backLabel, >- align: 'left', >- callback: lang.hitch(this, 'onBack') >- }]; > }, > > _setAppAttr: function(app) { >@@ -206,6 +198,43 @@ > return buttons; > }, > >+ getHeaderButtons: function() { >+ var buttons = [{ >+ name: 'close', >+ iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite', >+ label: this.backLabel, >+ align: 'left', >+ callback: lang.hitch(this, 'onBack') >+ }]; >+ >+ if (this.visibleApps && this.visibleApps.length) { >+ var currentIndex; >+ array.some(this.visibleApps, lang.hitch(this, function(iapp, idx) { >+ currentIndex = iapp.id === this.app.id ? idx : undefined; >+ return currentIndex >= 0; >+ })); >+ var prevApp = this.visibleApps[currentIndex - 1]; >+ var nextApp = this.visibleApps[currentIndex + 1]; >+ buttons.push({ >+ name: 'prev', >+ iconClass: 'umcLeftIconWhite', >+ label: prevApp ? _('Previous app') : '', >+ align: 'left', >+ disabled: !prevApp, >+ callback: lang.hitch(this, 'set', 'app', prevApp) >+ }); >+ buttons.push({ >+ name: 'next', >+ iconClass: 'umcRightIconWhite', >+ label: nextApp ? _('Next app') : '', >+ align: 'left', >+ disabled: !nextApp, >+ callback: lang.hitch(this, 'set', 'app', nextApp) >+ }); >+ } >+ return buttons; >+ }, >+ > getActionButtons: function() { > var buttons = []; > if (this.app.canInstall) { >@@ -382,6 +411,7 @@ > } > > this.set('navButtons', this.getButtons()); >+ this.set('headerButtons', this.getHeaderButtons()); > this._navButtons.set('style', {'margin-left': '-0.2em', 'margin-top': '1em'}); > this._navHeaderButtonContainer.addChild(this._navButtons); > >@@ -551,13 +581,13 @@ > }); > for (var i = 0; i < rating.value; i++) { > domConstruct.create('div', { >- 'class': 'umcAppRatingIcon', >+ 'class': 'umcAppRatingIcon' > }, ratingText.domNode > ); > } > domConstruct.create('div', { > 'class': 'umcAppRatingText', >- textContent: rating.label, >+ textContent: rating.label > }, ratingText.domNode > ); > domConstruct.create('div', { >Index: umc/js/appcenter/AppCenterPage.js >=================================================================== >--- umc/js/appcenter/AppCenterPage.js (Revision 66007) >+++ umc/js/appcenter/AppCenterPage.js (Arbeitskopie) >@@ -181,6 +181,19 @@ > return deferred; > }, > >+ getVisibleApps: function() { >+ // to show prev or next app on the AppDetailsPage >+ // we need all currently visible apps >+ var visibleApps = []; >+ array.forEach(this.metaCategories, function(metaCategory) { >+ if (metaCategory.grid.store) { // undefined if reloading AppDetailsPage >+ var apps = metaCategory.grid.store.query(metaCategory.filterQuery); >+ visibleApps = visibleApps.concat(apps); >+ } >+ }); >+ return visibleApps; >+ }, >+ > getApplications: function() { > if (!this._applications) { > return tools.umcpCommand('appcenter/query', {}).then(lang.hitch(this, function(data) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39664
:
7235
|
7315
|
7328
|
7349