diff --git a/public/javascripts/collections/list.js b/public/javascripts/collections/list.js index 0e6cdd6..c874f9b 100644 --- a/public/javascripts/collections/list.js +++ b/public/javascripts/collections/list.js @@ -21,7 +21,7 @@ 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); }, /** diff --git a/public/javascripts/views/page.js b/public/javascripts/views/page.js index 3e9a0b5..2815289 100644 --- a/public/javascripts/views/page.js +++ b/public/javascripts/views/page.js @@ -109,8 +109,8 @@ List updateBreadCrumbs: function(){ var rootId = this.getRootId(); + this.$('#task-breadcrumbs').empty(); if (rootId){ - this.$('#task-breadcrumbs').empty(); var current = this.collection.get(rootId); var breadCrumbs = '';//_.template('<%= content %>')(current.attributes); var depth=0; diff --git a/public/javascripts/views/task.js b/public/javascripts/views/task.js index a08689e..1e5a4ef 100644 --- a/public/javascripts/views/task.js +++ b/public/javascripts/views/task.js @@ -20,7 +20,7 @@ define( // The recursive tree view. Ref:http://jsfiddle.net/wassname/zf61mLvh/2/ var TaskView = Backbone.Marionette.CompositeView.extend({ - template: _.template(taskTemplate), //'#task-view-template', + template: _.template(taskTemplate), tagName: 'ul', className: "task-view", viewComparator: List.prototype.comporator, @@ -52,6 +52,8 @@ define( 'click .uncomplete:first': 'unmarkComlete', 'click .note:first': 'addNote', 'click .fold-button:first': 'foldChildren', + 'click .fold:first': 'foldChildren', + 'click .destroy:first': 'destroy', // custom events 'focus': 'this.model.focusOnView', @@ -65,11 +67,6 @@ define( initialize: function (options) { var task = this; - // options - if (!('reorderOnSort' in options)) { - options.reorderOnSort = true; - } - // backlink this.model.view = this; diff --git a/public/stylesheets/app.css b/public/stylesheets/app.css index 351b4ca..396dd9b 100644 --- a/public/stylesheets/app.css +++ b/public/stylesheets/app.css @@ -5732,7 +5732,7 @@ body #hackflowy #main .children ul.task-view { border-radius: 4px; font-family: 'Helvetica Neue', Arial, Sans-serif; z-index: 8; - margin-top: 8px; + margin-top: 16px; margin-left: -29px; } @@ -5791,7 +5791,7 @@ body #hackflowy #main .children ul.task-view { left: 0; /*height: 25px;*/ /*width: 90px;*/ - margin-top: -36px; + margin-top: -45px; margin-left: -3%; font-size: 1.5em; } @@ -5826,7 +5826,6 @@ body #hackflowy #main .children ul.task-view { #task-breadcrumbs { font-size: smaller; - } #task-breadcrumbs a { color: rgb(51, 51, 51); diff --git a/public/templates/task.html b/public/templates/task.html index 8295f1e..30fb4f1 100644 --- a/public/templates/task.html +++ b/public/templates/task.html @@ -11,6 +11,8 @@ <% }else { %> Complete
<% } %> + Fold
+ Delete
Add Note