Commits

Bob Bergman committed 7205e7d

More remove improvements

Comments (0)

Files changed (1)

src/main/resources/public/app.js

         this.setTitle("");
       }
       else {
-        this.$el.slideUp(150, function () {
+        trigger("remove", this.model);
+        this.$el.slideUp(100, function () {
+          var next = $(this).next().data("view");
+          if (next) next.focus();
           $(this).remove();
-          trigger("remove", this.model);
         });
       }
     },
       }
     },
     subtaskRemove: function (subtask) {
-      var index = this.collection.indexOf(subtask) + 2;
-      var $next = this.$el.find("li:nth-child(" + index + ")");
+      var index = this.collection.indexOf(subtask) + 1;
+      var $next = this.$el.find("li:nth-child(" + (index + 1) + ")");
       var view = $next.length > 0 ? $next.data("view") : this.getLastView();
       view.focus();
       view.ensureVisible();