Index: umc/js/appcenter.js =================================================================== --- umc/js/appcenter.js (Revision 66116) +++ 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/AppCenterPage.js =================================================================== --- umc/js/appcenter/AppCenterPage.js (Revision 66116) +++ 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) { Index: umc/js/appcenter/AppDetailsPage.js =================================================================== --- umc/js/appcenter/AppDetailsPage.js (Revision 66116) +++ 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 = -1; + 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', {