From 57284495de4a635ce752236cbe57896aa9283f88 Mon Sep 17 00:00:00 2001 From: Kiffin Gish Date: Fri, 23 Dec 2016 12:43:53 +0100 Subject: [PATCH] Toolbar action replaceText Should be possible to replace the current contents with some other text. --- app/assets/javascripts/discourse/components/d-editor.js.es6 | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index b4b3c31fb39..f9fc95e31fe 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -552,6 +552,7 @@ export default Ember.Component.extend({ applySurround: (head, tail, exampleKey, opts) => this._applySurround(selected, head, tail, exampleKey, opts), applyList: (head, exampleKey) => this._applyList(selected, head, exampleKey), addText: text => this._addText(selected, text), + replaceText: text => this._addText({pre: '', post: ''}, text), getText: () => this.get('value'), };