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 |
|