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

Collapse All | Expand All

(-)a/App.js (+1 lines)
 Lines 53-58   define([ Link Here 
53
			}
53
			}
54
			this.id = props.id;
54
			this.id = props.id;
55
			this.name = props.name;
55
			this.name = props.name;
56
			this.siblings = props.siblings;
56
			this.logoName = props.logo_name;
57
			this.logoName = props.logo_name;
57
			this.logoDetailPageName = props.logo_detail_page_name;
58
			this.logoDetailPageName = props.logo_detail_page_name;
58
			this.version = props.version;
59
			this.version = props.version;
(-)a/AppCenterMetaCategory.js (+11 lines)
 Lines 100-110   define([ Link Here 
100
					isContextAction: false,
100
					isContextAction: false,
101
					label: _('Open'),
101
					label: _('Open'),
102
					callback: lang.hitch(this, function(id, app) {
102
					callback: lang.hitch(this, function(id, app) {
103
						app.siblings = this._getCurrentSiblings();
103
						this.onShowApp(app);
104
						this.onShowApp(app);
104
					})
105
					})
105
				}]
106
				}]
106
			});
107
			});
107
108
109
			this._getCurrentSiblings = function() {
110
				// to show prev or next app on the AppDetailsPage
111
				// we need all ids of the current siblings
112
				var siblings = this.grid.store.query(this.filterQuery);
113
				var siblingIds = array.map(siblings, function(iapp) {
114
					return iapp.id;
115
				});
116
				return siblingIds;
117
			};
118
108
			this.addChild(this._label);
119
			this.addChild(this._label);
109
			this.own(this._label);
120
			this.own(this._label);
110
			//this.addChild(this.button);
121
			//this.addChild(this.button);
(-)a/AppDetailsPage.js (-1 / +38 lines)
 Lines 110-123   define([ 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
		},
113
114
114
			this.headerButtons = [{
115
		getHeaderButtons: function() {
116
			var buttons = [{
115
				name: 'close',
117
				name: 'close',
116
				iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite',
118
				iconClass: this.isSubPage ? 'umcArrowLeftIconWhite' : 'umcCloseIconWhite',
117
				label: this.backLabel,
119
				label: this.backLabel,
118
				align: 'left',
120
				align: 'left',
119
				callback: lang.hitch(this, 'onBack')
121
				callback: lang.hitch(this, 'onBack')
120
			}];
122
			}];
123
124
			if (this.app.siblings && this.app.siblings.length) {
125
				var idx = array.indexOf(this.app.siblings, this.app.id);
126
				var prev_idx = idx - 1;
127
				var next_idx = idx + 1;
128
				var isPrevIdxValid = prev_idx >= 0;
129
				var isNextIdxValid = next_idx < this.app.siblings.length;
130
				var app = {
131
					siblings: this.app.siblings
132
				};
133
				buttons.push({
134
					name: 'prev',
135
					iconClass: 'umcLeftIconWhite',
136
					label: isPrevIdxValid ? _('Previous app') : '',
137
					align: 'left',
138
					disabled: !isPrevIdxValid,
139
					callback: lang.hitch(this, 'loadApp', app, prev_idx)
140
				});
141
				buttons.push({
142
					name: 'next',
143
					iconClass: 'umcRightIconWhite',
144
					label: isNextIdxValid ? _('Next app') : '',
145
					align: 'left',
146
					disabled: !isNextIdxValid,
147
					callback: lang.hitch(this, 'loadApp', app, next_idx)
148
				});
149
			}
150
			return buttons;
151
		},
152
153
		loadApp: function(app, idx) {
154
			app.id = this.app.siblings[idx];
155
			this.set('app', app);
121
		},
156
		},
122
157
123
		_setAppAttr: function(app) {
158
		_setAppAttr: function(app) {
 Lines 131-136   define([ Link Here 
131
				// we need to ask the server,
166
				// we need to ask the server,
132
				// it is not yet known!
167
				// it is not yet known!
133
				appLoaded = tools.umcpCommand(this.getAppCommand, {'application': app.id}).then(function(data) {
168
				appLoaded = tools.umcpCommand(this.getAppCommand, {'application': app.id}).then(function(data) {
169
					data.result.siblings = app.siblings;
134
					return data.result;
170
					return data.result;
135
				});
171
				});
136
			}
172
			}
 Lines 382-387   define([ Link Here 
382
			}
418
			}
383
419
384
			this.set('navButtons', this.getButtons());
420
			this.set('navButtons', this.getButtons());
421
			this.set('headerButtons', this.getHeaderButtons());
385
			this._navButtons.set('style', {'margin-left': '-0.2em', 'margin-top': '1em'});
422
			this._navButtons.set('style', {'margin-left': '-0.2em', 'margin-top': '1em'});
386
			this._navHeaderButtonContainer.addChild(this._navButtons);
423
			this._navHeaderButtonContainer.addChild(this._navButtons);
387
424

Return to bug 39664