From 823b824881819f271f846b8163ed441bef8df50e Mon Sep 17 00:00:00 2001 From: Matthieu Boinet Date: Sat, 25 May 2013 19:50:07 +0200 Subject: [PATCH] rename settings model --- src/scripts/api.js | 6 +++--- src/scripts/main.js | 4 ++-- src/scripts/models.js | 2 +- src/scripts/views.js | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/scripts/api.js b/src/scripts/api.js index 7964cf7..3aa285e 100644 --- a/src/scripts/api.js +++ b/src/scripts/api.js @@ -68,8 +68,8 @@ define(['require','jquery','conf','router','models','utils'], } else { // SINGLE_USER_MODE - require('models').settingsModel.set("sid", data.content.session_id); - require('models').settingsModel.save(); + require('models').settings.set("sid", data.content.session_id); + require('models').settings.save(); window.location.reload(true); } @@ -91,7 +91,7 @@ define(['require','jquery','conf','router','models','utils'], ttRssApiCall: function(req, success, async){ var data = req; // circular dependency for models - var sid = require('models').settingsModel.get("sid"); + var sid = require('models').settings.get("sid"); if (sid != undefined){ data.sid = sid; diff --git a/src/scripts/main.js b/src/scripts/main.js index bc250a1..5b7c99b 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -58,8 +58,8 @@ requirejs(['jquery','backbone','conf','router','api','utils','models'], .done(function(data){ if (data.status == 0){ // we store the sessions id - models.settingsModel.set("sid", data.content.session_id); - models.settingsModel.save(); + models.settings.set("sid", data.content.session_id); + models.settings.save(); router.myRouter.setNextTransOptions({reverse: true, transition: "slideup"}); diff --git a/src/scripts/models.js b/src/scripts/models.js index 9204dd3..fba0366 100644 --- a/src/scripts/models.js +++ b/src/scripts/models.js @@ -403,7 +403,7 @@ define(['api','backbone','utils'], feedsModel: feedsModel, articlesModel: articlesModel, configModel: new ConfigModel(), - settingsModel: settings, + settings: settings, article: ArticleModel } diff --git a/src/scripts/views.js b/src/scripts/views.js index 06fcd22..d04341d 100644 --- a/src/scripts/views.js +++ b/src/scripts/views.js @@ -124,7 +124,7 @@ define(['jquery', 'models', 'templates','conf','utils'], var msg = "No categories"; - if (models.settingsModel.get("onlyUnread")){ + if (models.settings.get("onlyUnread")){ msg = "No unread categories"; } @@ -397,7 +397,7 @@ define(['jquery', 'models', 'templates','conf','utils'], var msg = "No feeds"; - if (models.settingsModel.get("onlyUnread")){ + if (models.settings.get("onlyUnread")){ msg = "No unread feeds"; } @@ -651,7 +651,7 @@ define(['jquery', 'models', 'templates','conf','utils'], // no elements in the collection // message depending on options - var msg = models.settingsModel.get("onlyUnread") ? + var msg = models.settings.get("onlyUnread") ? "No unread articles" :"No articles" ; this.$lv.html(tpl.roListElement({text: msg})); @@ -1095,7 +1095,7 @@ define(['jquery', 'models', 'templates','conf','utils'], initialize: function(){ // bind the view to the model - this.model = models.settingsModel; + this.model = models.settings; // load settings from localStorage & update values this.model.fetch();