From bafc7c810ae9ba8eb7193d6444138fbde43bb115 Mon Sep 17 00:00:00 2001 From: AlexandreNorman Date: Sun, 19 May 2013 10:49:50 +0200 Subject: [PATCH] some bugs corrections to make it works on touchpad --- src/scripts/models.js | 2 +- src/scripts/views.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/scripts/models.js b/src/scripts/models.js index 62c25c7..e876e25 100644 --- a/src/scripts/models.js +++ b/src/scripts/models.js @@ -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", diff --git a/src/scripts/views.js b/src/scripts/views.js index 93a35e9..45791d7 100644 --- a/src/scripts/views.js +++ b/src/scripts/views.js @@ -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 } }, @@ -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() { @@ -700,7 +706,7 @@ define(['jquery', 'models', 'templates','conf','utils'], this.model = new models.article({id: artId}); } } - + // update the view parts this.updateBackButton(); @@ -756,7 +762,7 @@ define(['jquery', 'models', 'templates','conf','utils'], } else { this.renderPrevNext(); } - + this.renderUnreadToggleButton(); this.listenTo(this.model, "change:unread", this.renderUnreadToggleButton);