Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250032

Change subject: AceEditorWidget: Add method to clear undo stack
......................................................................

AceEditorWidget: Add method to clear undo stack

After the widget is initialised the caller will probably
want to clear the undo stack, so that the first state
is the initial value provided.

Change-Id: Ia331acc4177e32784061cae55c450eb0f83fd744
---
M modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/32/250032/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
index 4a73121..b5c2180 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
@@ -117,6 +117,21 @@
 };
 
 /**
+ * Clear the editor's undo stack
+ *
+ * @chainable
+ */
+ve.ui.MWAceEditorWidget.prototype.clearUndoStack = function () {
+       var widget = this;
+       this.loadingPromise.done( function () {
+               widget.editor.session.setUndoManager(
+                       new ace.UndoManager()
+               );
+       } );
+       return this;
+};
+
+/**
  * Toggle the visibility of line numbers
  *
  * @param {boolean} visible Visible

-- 
To view, visit https://gerrit.wikimedia.org/r/250032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia331acc4177e32784061cae55c450eb0f83fd744
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to