Skip to content

Commit

Permalink
Merge pull request #404 from gryphonmyers/ft-entry-write-events
Browse files Browse the repository at this point in the history
triggered js events for collection save and remove
  • Loading branch information
aheinze committed Mar 30, 2016
2 parents 7df16a7 + e13c592 commit 247b5df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/core/Collections/assets/js/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
$timeout(function(){
$scope.entries.splice(index, 1);
$scope.collection.count -= 1;

App.trigger("entry.remove", {
collection: $scope.collection,
entryId: entryId
});
App.notify(App.i18n.get("Entry removed"), "success");
}, 0);
}).error(App.module.callbacks.error.http);
Expand Down
5 changes: 4 additions & 1 deletion modules/core/Collections/assets/js/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@
if (data && Object.keys(data).length) {
$scope.entry = data;
App.notify(App.i18n.get("Entry saved!"), "success");

App.trigger("entry.save", {
entry: entry,
collection: collection
});
$scope.loadVersions();
}

Expand Down

0 comments on commit 247b5df

Please sign in to comment.