|
Lines 553-559
Link Here
|
| 553 |
module = this.getModule(module, flavor); |
553 |
module = this.getModule(module, flavor); |
| 554 |
} |
554 |
} |
| 555 |
if (undefined === module) { |
555 |
if (undefined === module) { |
| 556 |
return; |
556 |
return undefined; |
| 557 |
} |
557 |
} |
| 558 |
|
558 |
|
| 559 |
// create a new tab |
559 |
// create a new tab |
|
Lines 561-582
Link Here
|
| 561 |
// force any tooltip to hide |
561 |
// force any tooltip to hide |
| 562 |
Tooltip._masterTT && Tooltip._masterTT.fadeOut.play(); |
562 |
Tooltip._masterTT && Tooltip._masterTT.fadeOut.play(); |
| 563 |
|
563 |
|
| 564 |
var params = lang.mixin({ |
564 |
var tab = undefined; // will be the module |
| 565 |
title: module.name, |
565 |
if (module.BaseClass.prototype.unique) { |
| 566 |
iconClass: tools.getIconClass(module.icon), |
566 |
var sameModules = array.filter(this._tabContainer.getChildren(), function(i) { |
| 567 |
closable: tools.status('overview'), // closing tabs is only enabled if the overview is visible |
567 |
return i.moduleID == module.id; |
| 568 |
moduleFlavor: module.flavor, |
568 |
}); |
| 569 |
moduleID: module.id, |
569 |
if (sameModules.length) { |
| 570 |
description: module.description |
570 |
tab = sameModules[0]; |
| 571 |
}, props); |
571 |
} |
| 572 |
var tab = new module.BaseClass(params); |
572 |
} |
| 573 |
this._tabContainer.addChild(tab); |
573 |
if (!tab) { |
|
|
574 |
// module is not open yet, open it |
| 575 |
var params = lang.mixin({ |
| 576 |
title: module.name, |
| 577 |
iconClass: tools.getIconClass(module.icon), |
| 578 |
closable: tools.status('overview'), // closing tabs is only enabled if the overview is visible |
| 579 |
moduleFlavor: module.flavor, |
| 580 |
moduleID: module.id, |
| 581 |
description: module.description |
| 582 |
}, props); |
| 583 |
tab = new module.BaseClass(params); |
| 584 |
this._tabContainer.addChild(tab); |
| 585 |
tab.startup(); |
| 586 |
tools.checkReloadRequired(); |
| 587 |
} |
| 574 |
this._tabContainer.selectChild(tab, true); |
588 |
this._tabContainer.selectChild(tab, true); |
| 575 |
tab.startup(); |
589 |
return tab; |
| 576 |
tools.checkReloadRequired(); |
|
|
| 577 |
} catch (err) { |
590 |
} catch (err) { |
| 578 |
console.warn('Error initializing module ' + module.id + ':', err); |
591 |
console.warn('Error initializing module ' + module.id + ':', err); |
| 579 |
tools.checkReloadRequired(); |
592 |
tools.checkReloadRequired(); |
|
|
593 |
return undefined; |
| 580 |
} |
594 |
} |
| 581 |
}, |
595 |
}, |
| 582 |
|
596 |
|