diff --git a/app/scripts/app.js b/app/scripts/app.js index 3caa72de..df295b10 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -10,6 +10,7 @@ var AppModel = require('./models/app-model'), Updater = require('./comp/updater'), AuthReceiver = require('./comp/auth-receiver'), ExportApi = require('./comp/export-api'), + Storage = require('./storage'), SettingsManager = require('./util/settings-manager'), Locale = require('./util/locale'); @@ -77,6 +78,7 @@ $(() => { } function showView() { + appModel.prepare(); new AppView({ model: appModel }).render(); Updater.init(); SingleInstanceChecker.init(); diff --git a/app/scripts/models/app-model.js b/app/scripts/models/app-model.js index 60d9145c..1e1382bc 100644 --- a/app/scripts/models/app-model.js +++ b/app/scripts/models/app-model.js @@ -43,8 +43,11 @@ var AppModel = Backbone.Model.extend({ this.listenTo(Backbone, 'select-entry', this.selectEntry); this.appLogger = new Logger('app'); + }, + prepare: function() { AutoType.init(this); + _.forEach(Storage, prv => prv.init()); }, loadConfig: function(configLocation, callback) { diff --git a/app/scripts/storage/index.js b/app/scripts/storage/index.js index 816f6112..971a29e5 100644 --- a/app/scripts/storage/index.js +++ b/app/scripts/storage/index.js @@ -11,6 +11,4 @@ var Storage = { cache: Launcher ? require('./storage-file-cache') : require('./storage-cache') }; -_.forEach(Storage, prv => prv.init()); - module.exports = Storage; diff --git a/util/config-example.json b/util/config-example.json index aac4117c..5754a606 100644 --- a/util/config-example.json +++ b/util/config-example.json @@ -40,8 +40,8 @@ }, "files": [{ "storage": "webdav", - "name": "", - "path": "", + "name": "My file", + "path": "webdav-url", "options": { "user": "", "password": "" } }] }