Skip to content

Commit

Permalink
some bugs corrections to make it works on touchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrenorman committed May 19, 2013
1 parent 3df73b1 commit bafc7c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/scripts/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ define(['api','backbone','utils'],
function(m){

if (m.length == 0){
utils.log("ArticleModel.sync: recived nothing for article " +
utils.log("ArticleModel.sync: received nothing for article " +
model.id);
model.set("title", "Error");
model.set("content",
Expand Down
14 changes: 10 additions & 4 deletions src/scripts/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ define(['jquery', 'models', 'templates','conf','utils'],
if (this.model.get('unread') == 0){
this.el.classList.add('read');
} else {
this.el.classList.remove('read');
// this.el.classList.remove('read'); // BUG HERE on HP Touchpad
}
},

Expand Down Expand Up @@ -469,7 +469,13 @@ define(['jquery', 'models', 'templates','conf','utils'],
}, // render

updateUnread: function(){
this.el.classList.toggle("read");
// make articles with 0 unread not bold
//this.el.classList.toggle('read'); // BUG on HP touchpad !
if (this.model.get('unread') == 0){
this.model.set('unread', false);
} else {
this.model.set('unread', true);
}
},

initialize: function() {
Expand Down Expand Up @@ -700,7 +706,7 @@ define(['jquery', 'models', 'templates','conf','utils'],
this.model = new models.article({id: artId});
}
}

// update the view parts
this.updateBackButton();

Expand Down Expand Up @@ -756,7 +762,7 @@ define(['jquery', 'models', 'templates','conf','utils'],
} else {
this.renderPrevNext();
}

this.renderUnreadToggleButton();
this.listenTo(this.model, "change:unread",
this.renderUnreadToggleButton);
Expand Down

0 comments on commit bafc7c8

Please sign in to comment.