Univention Bugzilla – Attachment 5766 Details for
Bug 31855
Preventing certain UMC modules from being opened multiple times
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Support "unique" in a module; return the module of openModule()
31855.patch (text/plain), 1.92 KB, created by
Dirk Wiesenthal
on 2014-01-31 15:54:50 CET
(
hide
)
Description:
Support "unique" in a module; return the module of openModule()
Filename:
MIME Type:
Creator:
Dirk Wiesenthal
Created:
2014-01-31 15:54:50 CET
Size:
1.92 KB
patch
obsolete
>Index: umc/app.js >=================================================================== >--- umc/app.js (Revision 47548) >+++ umc/app.js (Arbeitskopie) >@@ -553,7 +553,7 @@ > module = this.getModule(module, flavor); > } > if (undefined === module) { >- return; >+ return undefined; > } > > // create a new tab >@@ -561,22 +561,36 @@ > // force any tooltip to hide > Tooltip._masterTT && Tooltip._masterTT.fadeOut.play(); > >- var params = lang.mixin({ >- title: module.name, >- iconClass: tools.getIconClass(module.icon), >- closable: tools.status('overview'), // closing tabs is only enabled if the overview is visible >- moduleFlavor: module.flavor, >- moduleID: module.id, >- description: module.description >- }, props); >- var tab = new module.BaseClass(params); >- this._tabContainer.addChild(tab); >+ var tab = undefined; // will be the module >+ if (module.BaseClass.prototype.unique) { >+ var sameModules = array.filter(this._tabContainer.getChildren(), function(i) { >+ return i.moduleID == module.id; >+ }); >+ if (sameModules.length) { >+ tab = sameModules[0]; >+ } >+ } >+ if (!tab) { >+ // module is not open yet, open it >+ var params = lang.mixin({ >+ title: module.name, >+ iconClass: tools.getIconClass(module.icon), >+ closable: tools.status('overview'), // closing tabs is only enabled if the overview is visible >+ moduleFlavor: module.flavor, >+ moduleID: module.id, >+ description: module.description >+ }, props); >+ tab = new module.BaseClass(params); >+ this._tabContainer.addChild(tab); >+ tab.startup(); >+ tools.checkReloadRequired(); >+ } > this._tabContainer.selectChild(tab, true); >- tab.startup(); >- tools.checkReloadRequired(); >+ return tab; > } catch (err) { > console.warn('Error initializing module ' + module.id + ':', err); > tools.checkReloadRequired(); >+ return undefined; > } > }, >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31855
: 5766