Skip to content

Commit

Permalink
ignore the removed note in save layout
Browse files Browse the repository at this point in the history
  • Loading branch information
yguan committed Nov 16, 2013
1 parent 2d7c446 commit beb2602
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/js/view/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ define(function (require, exports, module) {
}

function saveLayout(notes, gridsterWidgetOptions) {
_.each(notes, function (note, index) {
angular.extend(note.gridsterOptions, gridsterWidgetOptions[index]);
var index = 0;
_.each(notes, function (note) {
if (!note.remove) {
angular.extend(note.gridsterOptions, gridsterWidgetOptions[index]);
index = index + 1;
}
});
noteRepo.updateAll(notes, {success: genericHandlers.noop, failure: genericHandlers.error});
}
Expand Down

0 comments on commit beb2602

Please sign in to comment.