View | Details | Raw Unified | Return to bug 39664 | Differences between
and this patch

Collapse All | Expand All

(-)umc/js/appcenter.js (-3 / +4 lines)
 Lines 125-132    Link Here 
125
125
126
		_getModuleStateAttr: function() {
126
		_getModuleStateAttr: function() {
127
			var state = [];
127
			var state = [];
128
			var _selectedWidget = lang.getObject('selectedChildWidget', false, this)
128
			var _selectedWidget = lang.getObject('selectedChildWidget', false, this);
129
			var _app = lang.getObject('selectedChildWidget.app', false, this)
129
			var _app = lang.getObject('selectedChildWidget.app', false, this);
130
			if (_selectedWidget == this._appCenterPage) {
130
			if (_selectedWidget == this._appCenterPage) {
131
				state = ['category', this._appCenterPage._searchSidebar.get('category')];
131
				state = ['category', this._appCenterPage._searchSidebar.get('category')];
132
			} else if (_app) {
132
			} else if (_app) {
 Lines 177-183    Link Here 
177
177
178
		showApp: function(app) {
178
		showApp: function(app) {
179
			topic.publish('/umc/actions', this.moduleID, this.moduleFlavor, app.id, 'show');
179
			topic.publish('/umc/actions', this.moduleID, this.moduleFlavor, app.id, 'show');
180
			tools.umcpCommand('appcenter/ping')
180
			tools.umcpCommand('appcenter/ping');
181
			//this.standby(true);
181
			//this.standby(true);
182
			var appDetailsDialog = new AppDetailsDialog({
182
			var appDetailsDialog = new AppDetailsDialog({
183
				moduleID: this.moduleID,
183
				moduleID: this.moduleID,
 Lines 208-213    Link Here 
208
				detailsDialog: appDetailsDialog,
208
				detailsDialog: appDetailsDialog,
209
				configDialog: appConfigDialog,
209
				configDialog: appConfigDialog,
210
				hostDialog: appChooseHostDialog,
210
				hostDialog: appChooseHostDialog,
211
				visibleApps: this._appCenterPage.getVisibleApps(),
211
				udmAccessible: this.udmAccessible(),
212
				udmAccessible: this.udmAccessible(),
212
				standby: lang.hitch(this, 'standby'),
213
				standby: lang.hitch(this, 'standby'),
213
				standbyDuring: lang.hitch(this, 'standbyDuring'),
214
				standbyDuring: lang.hitch(this, 'standbyDuring'),
(-)umc/js/appcenter/AppDetailsPage.js (-10 / +40 lines)
 Lines 110-123    Link Here 
110
			this.own(this._progressBar);
110
			this.own(this._progressBar);
111
			this._grid = new AppCenterGallery({});
111
			this._grid = new AppCenterGallery({});
112
			this.own(this._grid);
112
			this.own(this._grid);
113
114
			this.headerButtons = [{
115
				name: 'close',
116
				iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite',
117
				label: this.backLabel,
118
				align: 'left',
119
				callback: lang.hitch(this, 'onBack')
120
			}];
121
		},
113
		},
122
114
123
		_setAppAttr: function(app) {
115
		_setAppAttr: function(app) {
 Lines 206-211    Link Here 
206
			return buttons;
198
			return buttons;
207
		},
199
		},
208
200
201
		getHeaderButtons: function() {
202
			var buttons = [{
203
				name: 'close',
204
				iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite',
205
				label: this.backLabel,
206
				align: 'left',
207
				callback: lang.hitch(this, 'onBack')
208
			}];
209
210
			if (this.visibleApps && this.visibleApps.length) {
211
				var currentIndex;
212
				array.some(this.visibleApps, lang.hitch(this, function(iapp, idx) {
213
					currentIndex = iapp.id === this.app.id ? idx : undefined;
214
					return currentIndex >= 0;
215
				}));
216
				var prevApp = this.visibleApps[currentIndex - 1];
217
				var nextApp = this.visibleApps[currentIndex + 1];
218
				buttons.push({
219
					name: 'prev',
220
					iconClass: 'umcLeftIconWhite',
221
					label: prevApp ? _('Previous app') : '',
222
					align: 'left',
223
					disabled: !prevApp,
224
					callback: lang.hitch(this, 'set', 'app', prevApp)
225
				});
226
				buttons.push({
227
					name: 'next',
228
					iconClass: 'umcRightIconWhite',
229
					label: nextApp ? _('Next app') : '',
230
					align: 'left',
231
					disabled: !nextApp,
232
					callback: lang.hitch(this, 'set', 'app', nextApp)
233
				});
234
			}
235
			return buttons;
236
		},
237
209
		getActionButtons: function() {
238
		getActionButtons: function() {
210
			var buttons = [];
239
			var buttons = [];
211
			if (this.app.canInstall) {
240
			if (this.app.canInstall) {
 Lines 382-387    Link Here 
382
			}
411
			}
383
412
384
			this.set('navButtons', this.getButtons());
413
			this.set('navButtons', this.getButtons());
414
			this.set('headerButtons', this.getHeaderButtons());
385
			this._navButtons.set('style', {'margin-left': '-0.2em', 'margin-top': '1em'});
415
			this._navButtons.set('style', {'margin-left': '-0.2em', 'margin-top': '1em'});
386
			this._navHeaderButtonContainer.addChild(this._navButtons);
416
			this._navHeaderButtonContainer.addChild(this._navButtons);
387
417
 Lines 551-563    Link Here 
551
					});
581
					});
552
					for (var i = 0; i < rating.value; i++) {
582
					for (var i = 0; i < rating.value; i++) {
553
						domConstruct.create('div', {
583
						domConstruct.create('div', {
554
								'class': 'umcAppRatingIcon',
584
								'class': 'umcAppRatingIcon'
555
							}, ratingText.domNode
585
							}, ratingText.domNode
556
						);
586
						);
557
					}
587
					}
558
					domConstruct.create('div', {
588
					domConstruct.create('div', {
559
							'class': 'umcAppRatingText',
589
							'class': 'umcAppRatingText',
560
							textContent: rating.label,
590
							textContent: rating.label
561
						}, ratingText.domNode
591
						}, ratingText.domNode
562
					);
592
					);
563
					domConstruct.create('div', {
593
					domConstruct.create('div', {
(-)umc/js/appcenter/AppCenterPage.js (+13 lines)
 Lines 181-186    Link Here 
181
			return deferred;
181
			return deferred;
182
		},
182
		},
183
183
184
		getVisibleApps: function() {
185
			// to show prev or next app on the AppDetailsPage
186
			// we need all currently visible apps
187
			var visibleApps = [];
188
			array.forEach(this.metaCategories, function(metaCategory) {
189
				if (metaCategory.grid.store) { // undefined if reloading AppDetailsPage
190
					var apps = metaCategory.grid.store.query(metaCategory.filterQuery);
191
					visibleApps = visibleApps.concat(apps);
192
				}
193
			});
194
			return visibleApps;
195
		},
196
184
		getApplications: function() {
197
		getApplications: function() {
185
			if (!this._applications) {
198
			if (!this._applications) {
186
				return tools.umcpCommand('appcenter/query', {}).then(lang.hitch(this, function(data) {
199
				return tools.umcpCommand('appcenter/query', {}).then(lang.hitch(this, function(data) {

Return to bug 39664