diff options
author | zefanja <zefanja@freenet.de> | 2014-02-01 21:22:04 +0700 |
---|---|---|
committer | zefanja <zefanja@freenet.de> | 2014-02-01 21:22:04 +0700 |
commit | 6ba78145337594b1e118b25e887bb685681cc646 (patch) | |
tree | 3b7a6bb8d1e77f383fcd443b25a0c8dac703dbb9 /source/App.js | |
parent | ad32f20588c68ffa05d24a6cc843634b28603b82 (diff) | |
download | biblez-ng-6ba78145337594b1e118b25e887bb685681cc646.tar.gz |
* create different views only when they are needed
* updated to latest sword.js
Diffstat (limited to 'source/App.js')
-rw-r--r-- | source/App.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/App.js b/source/App.js index 01b4886..d88d349 100644 --- a/source/App.js +++ b/source/App.js @@ -20,13 +20,13 @@ enyo.kind({ onOpenDataView: "openDataView", onOpenAbout: "openAbout" }, - {name: "moduleManager", kind: "biblez.moduleManager", onBack: "handleBack", onInstalled: "handleInstalledModule"}, {name: "bcSelector", kind: "biblez.bcSelector", onSelect: "handlePassageSelect", onBack: "handleBack"}, + /*{name: "moduleManager", kind: "biblez.moduleManager", onBack: "handleBack", onInstalled: "handleInstalledModule"}, {name: "moduleManagerDesktop", kind: "biblez.moduleManagerDesktop", onBack: "handleBack", onInstalled: "handleInstalledModule"}, {name: "settings", kind: "biblez.settings", onBack: "handleBack", onChange: "handleSettings"}, {name: "notes", kind: "biblez.notes", onBack: "handleBack", onChange: "handleNote"}, {name: "dataView", kind: "biblez.dataView", onBack: "handleBack", onVerse: "handleVerse"}, - {name: "about", kind: "biblez.about", onBack: "handleBack"} + {name: "about", kind: "biblez.about", onBack: "handleBack"}*/ ]} ], @@ -40,6 +40,7 @@ enyo.kind({ handleBack: function (inSender, inEvent) { this.$.panel.selectPanelByName("main"); + enyo.asyncMethod(inSender, "destroy"); return true; }, @@ -49,9 +50,11 @@ enyo.kind({ }, openModuleManager: function (inSender, inEvent) { - if(!enyo.platform.firefoxOS) + if(!enyo.platform.firefoxOS) { + this.$.panel.createComponent({name: "moduleManagerDesktop", kind: "biblez.moduleManagerDesktop", onBack: "handleBack", onInstalled: "handleInstalledModule"}, {owner: this}).render(); this.$.panel.selectPanelByName("moduleManagerDesktop"); - else { + } else { + this.$.panel.createComponent({name: "moduleManager", kind: "biblez.moduleManager", onBack: "handleBack", onInstalled: "handleInstalledModule"}, {owner: this}).render(); this.$.panel.selectPanelByName("moduleManager"); this.$.moduleManager.start(); } @@ -77,6 +80,7 @@ enyo.kind({ }, openPreferences: function (inSender, inEvent) { + this.$.panel.createComponent({name: "settings", kind: "biblez.settings", onBack: "handleBack", onChange: "handleSettings"}, {owner: this}).render(); this.$.settings.setSettings(); this.$.panel.selectPanelByName("settings"); }, @@ -86,6 +90,7 @@ enyo.kind({ }, openNotes: function (inSender, inEvent) { + this.$.panel.createComponent({name: "notes", kind: "biblez.notes", onBack: "handleBack", onChange: "handleNote"}, {owner: this}).render(); this.$.notes.setOsisRef(inEvent.osisRef); this.$.notes.setNoteId(inEvent.noteId); this.$.panel.selectPanelByName("notes"); @@ -97,17 +102,20 @@ enyo.kind({ }, openDataView: function (inSender, inEvent) { + this.$.panel.createComponent({name: "dataView", kind: "biblez.dataView", onBack: "handleBack", onVerse: "handleVerse"}, {owner: this}).render(); this.$.dataView.updateSection(inEvent.section); this.$.panel.selectPanelByName("dataView"); }, handleVerse: function (inSender, inEvent) { + inSender.destroy(); this.$.main.handlePassage(inEvent.osisRef); this.$.panel.selectPanelByName("main"); return true; }, openAbout: function (inSender, inEvent) { + this.$.panel.createComponent({name: "about", kind: "biblez.about", onBack: "handleBack"}, {owner: this}).render(); this.$.panel.selectPanelByName("about"); } }); |