|
Lines 36-41
Link Here
|
| 36 |
"dojo/dom-class", |
36 |
"dojo/dom-class", |
| 37 |
"dojo/topic", |
37 |
"dojo/topic", |
| 38 |
"dojo/Deferred", |
38 |
"dojo/Deferred", |
|
|
39 |
"dijit/registry", |
| 39 |
"dojox/string/sprintf", |
40 |
"dojox/string/sprintf", |
| 40 |
"umc/dialog", |
41 |
"umc/dialog", |
| 41 |
"umc/app", |
42 |
"umc/app", |
|
Lines 45-51
Link Here
|
| 45 |
"umc/modules/updater/Page", |
46 |
"umc/modules/updater/Page", |
| 46 |
"umc/modules/updater/Form", |
47 |
"umc/modules/updater/Form", |
| 47 |
"umc/i18n!umc/modules/updater" |
48 |
"umc/i18n!umc/modules/updater" |
| 48 |
], function(declare, lang, array, all, domClass, topic, Deferred, sprintf, dialog, UMCApplication, tools, store, TitlePane, Page, Form, _) { |
49 |
], function(declare, lang, array, all, domClass, topic, Deferred, dijitRegistry, sprintf, dialog, UMCApplication, tools, store, TitlePane, Page, Form, _) { |
|
|
50 |
var _getParentWidget = function(widget) { |
| 51 |
try { |
| 52 |
return dijitRegistry.getEnclosingWidget(widget.domNode.parentNode) |
| 53 |
} catch(e) { |
| 54 |
// could not access _widget.domNode.parentNode |
| 55 |
return null; |
| 56 |
} |
| 57 |
}; |
| 58 |
|
| 49 |
return declare("umc.modules.updater.UpdatesPage", Page, { |
59 |
return declare("umc.modules.updater.UpdatesPage", Page, { |
| 50 |
|
60 |
|
| 51 |
_last_reboot: false, |
61 |
_last_reboot: false, |
|
Lines 64-69
Link Here
|
| 64 |
}); |
74 |
}); |
| 65 |
}, |
75 |
}, |
| 66 |
|
76 |
|
|
|
77 |
_getEnclosingTitlePane: function(widgetName) { |
| 78 |
var _widget = this._form.getWidget(widgetName) || this._form.getButton(widgetName); |
| 79 |
while (_widget != null) { |
| 80 |
if (_widget.isInstanceOf(TitlePane)) { |
| 81 |
// we successfully found the enclosing TitlePane of the given widget |
| 82 |
return _widget; |
| 83 |
} |
| 84 |
if (_widget.isInstanceOf(Form)) { |
| 85 |
// do not search beyond the form widget |
| 86 |
return null; |
| 87 |
} |
| 88 |
_widget = _getParentWidget(_widget); |
| 89 |
} |
| 90 |
}, |
| 91 |
|
| 67 |
buildRendering: function() { |
92 |
buildRendering: function() { |
| 68 |
|
93 |
|
| 69 |
this.inherited(arguments); |
94 |
this.inherited(arguments); |
|
Lines 81-87
Link Here
|
| 81 |
'class': 'umcUpdaterWarningText', |
106 |
'class': 'umcUpdaterWarningText', |
| 82 |
visible: false, |
107 |
visible: false, |
| 83 |
label: '', |
108 |
label: '', |
| 84 |
content: '', // will be set bellow as soon as the UCS version is known |
109 |
content: '', // will be set below as soon as the UCS version is known |
| 85 |
}, |
110 |
}, |
| 86 |
{ |
111 |
{ |
| 87 |
type: 'Text', |
112 |
type: 'Text', |
|
Lines 469-478
Link Here
|
| 469 |
// fetch all known/initial titlepanes and save them with their name |
494 |
// fetch all known/initial titlepanes and save them with their name |
| 470 |
// so they can be used later on |
495 |
// so they can be used later on |
| 471 |
this._titlepanes = { |
496 |
this._titlepanes = { |
| 472 |
reboot: this._form._container.getChildren()[0], |
497 |
reboot: this._getEnclosingTitlePane('reboot'), |
| 473 |
easymode: this._form._container.getChildren()[1], |
498 |
easymode: this._getEnclosingTitlePane('easy_upgrade'), |
| 474 |
release: this._form._container.getChildren()[2], |
499 |
release: this._getEnclosingTitlePane('run_release_update'), |
| 475 |
packages: this._form._container.getChildren()[3] |
500 |
packages: this._getEnclosingTitlePane('run_packages_update') |
| 476 |
}; |
501 |
}; |
| 477 |
|
502 |
|
| 478 |
// Before we attach the form to our page, just switch off all title panes. |
503 |
// Before we attach the form to our page, just switch off all title panes. |