Skip to content

Instantly share code, notes, and snippets.

@erkie

erkie/hell.js Secret

Created August 2, 2012 09:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save erkie/15f035a5922a8ba5a877 to your computer and use it in GitHub Desktop.
hell
markAsRead: function(link) {
if ( this.unreadPosts.indexOf(link) != -1 )
this.unreadPosts.remove(link);
this.db.transaction(function(tx) {
tx.executeSql(
'UPDATE posts SET is_read = 1 WHERE link = ? AND feed_id = ?',
[link, this.id],
function(tx, res) {
this.posts.forEach(function(post) { if ( post.link == link ) post.is_read = true; });
feedreader.setCount();
}.bind(this), sqlError
);
}.bind(this));
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment