diff --git a/static/library.js b/static/library.js index 6f0fb37..34d1ee8 100644 --- a/static/library.js +++ b/static/library.js @@ -11,6 +11,7 @@ return { editing: false, saving: false, + trackForReset: {}, } }, computed: { @@ -20,9 +21,17 @@ }, methods: { edit: function() { + if (this.editing) { + return; + } + this.trackForReset = Object.assign({}, this.track); this.saving = false; this.editing = true; }, + cancel: function() { + this.track = Object.assign({}, this.trackForReset); + this.editing = false; + }, save: function() { this.saving = true; @@ -55,7 +64,7 @@ template: `