Merge branch 'master' into gh-pages

Conflicts:
	javascripts/vendor/custom.modernizr.js
	javascripts/vendor/zepto.js
	mockup.html
	stylesheets/normalize.css
This commit is contained in:
2016-02-01 17:05:29 +08:00
17 changed files with 343 additions and 2569 deletions
+15 -5
View File
@@ -21,23 +21,33 @@ localforageBackbone
initialize: function(){
// update order on add, remove.
// Ref: http://stackoverflow.com/a/11665085/221742
this.on('add remove', this.updateModelPriority);
this.on('add remove sort', this.updateModelPriority);
},
/**
* Move a model in the list up. Only a sort event is emitted
* @param {Backbone.Model} model - Model to be moved
*/
moveUp: function(model) { // I see move up as the -1
var index = this.indexOf(model);
if (index > 0) {
this.remove(model, {silent: true}); // silence this to stop excess event triggers
this.add(model, {at: index-1});
this.remove(model, {silent: true});
this.add(model, {at: index-1, silent: true});
}
this.trigger('sort', this, {});
},
/**
* Move a model in the list up. Only a sort event is emitted
* @param {Backbone.Model} model - Model to be moved
*/
moveDown: function(model) { // I see move up as the -1
var index = this.indexOf(model);
if (index < this.models.length) {
this.remove(model, {silent: true}); // silence this to stop excess event triggers
this.add(model, {at: index+1});
this.remove(model, {silent: true});
this.add(model, {at: index+1, silent: true});
}
this.trigger('sort', this, {});
},
/** Updated priority of each member of list **/