onLaunch: function(app) {
Decshee.Application = app;
console.log('Decshee.Application: ' + Decshee.Application);
+ Decshee.AddIns = {};
Decshee.Viewport = Ext.getCmp('Decshee.Viewport');
console.log('Decshee.Viewport: ' + Decshee.Viewport);
}
// アドインのロード
var srcPath = 'addins/' + id;
var packagePath = 'Decshee.' + id;
+ var rootPath = packagePath + '.controller.Root';
+ var rootPanelPath = packagePath + '.view.Panel';
+
console.log(srcPath);
console.log(packagePath);
- Ext.Loader.setPath(packagePath, srcPath);
- Ext.require(packagePath + '.*');
-
- var rootPath = packagePath + '.controller.Root';
console.log(rootPath);
- var rootController = Decshee.Application.getController(rootPath);
- console.log(rootController);
- rootController.init();
- // タブを追加。
- me.add(
- {
- title: caption,
- itemId: tabId,
- iconCls: 'tabs',
- closable: true,
- layout: 'fit',
- items: [
- { xtype: 'memberpanel' }
- ]
- }
- );
- tab = me.child('#' + tabId);
+ var addin = Decshee.AddIns[id];
+ if (addin == null) {
+
+ Ext.Loader.setPath(packagePath, srcPath);
+ Ext.require(packagePath + '.*');
+
+ var rootController = Decshee.Application.getController(rootPath);
+ console.log(rootController);
+ rootController.init();
+
+ Decshee.AddIns[id] = rootController;
+ console.log('AddIn [' + id + '] has not loaded.');
+ }
+
+ try {
+ // タブを追加。
+ me.add(
+ {
+ title: caption,
+ itemId: tabId,
+ iconCls: 'tabs',
+ closable: true,
+ layout: 'fit',
+ items: [
+ { xtype: id + 'rootpanel' }
+ ]
+ }
+ );
+ tab = me.child('#' + tabId);
+ } catch(e) {
+ alert(e);
+ }
}
tab.show();
}