Skip to content

Commit

Permalink
rename settings model
Browse files Browse the repository at this point in the history
  • Loading branch information
mboinet committed May 25, 2013
1 parent 54de540 commit 823b824
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/scripts/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"});

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ define(['api','backbone','utils'],
feedsModel: feedsModel,
articlesModel: articlesModel,
configModel: new ConfigModel(),
settingsModel: settings,
settings: settings,
article: ArticleModel

}
Expand Down
8 changes: 4 additions & 4 deletions src/scripts/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down Expand Up @@ -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";
}

Expand Down Expand Up @@ -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}));
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 823b824

Please sign in to comment.