diff --git a/assets/js/src/newsletter_editor/components/history.js b/assets/js/src/newsletter_editor/components/history.js index b21cac3cee..cb47d702c5 100644 --- a/assets/js/src/newsletter_editor/components/history.js +++ b/assets/js/src/newsletter_editor/components/history.js @@ -12,6 +12,11 @@ Module.HistoryView = Marionette.View.extend({ undo: null, }, + events: { + 'click #mailpoet-history-arrow-undo': 'undo', + 'click #mailpoet-history-arrow-redo': 'redo', + }, + model: { states: [], // from newest currentStateIndex: 0, @@ -52,6 +57,18 @@ Module.HistoryView = Marionette.View.extend({ return this.model.currentStateIndex !== 0; }, + undo: function undo() { + if (!this.canUndo()) { + return; + } + }, + + redo: function redo() { + if (!this.canRedo()) { + return; + } + }, + updateArrowsUI: function updateArrowsUI() { this.elements.undo.addClass('mailpoet_history_arrow_inactive'); this.elements.redo.addClass('mailpoet_history_arrow_inactive');