mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-15 03:34:44 +00:00
Merge "Use textSelection API to modify textarea"
This commit is contained in:
commit
2b2d29e603
|
@ -91,6 +91,7 @@
|
|||
"ext.templateData.images",
|
||||
"ext.templateDataGenerator.data",
|
||||
"jquery.uls.data",
|
||||
"jquery.textSelection",
|
||||
"ext.templateDataGenerator.ui.images"
|
||||
],
|
||||
"messages": [
|
||||
|
|
|
@ -338,11 +338,11 @@ mw.TemplateData.TextareaTarget = function mwTemplateDataTextareaTarget( $textare
|
|||
OO.inheritClass( mw.TemplateData.TextareaTarget, mw.TemplateData.Target );
|
||||
|
||||
mw.TemplateData.TextareaTarget.prototype.getWikitext = function () {
|
||||
return this.$textarea.val();
|
||||
return this.$textarea.textSelection( 'getContents' );
|
||||
};
|
||||
|
||||
mw.TemplateData.TextareaTarget.prototype.setWikitext = function ( newWikitext ) {
|
||||
this.$textarea.val( newWikitext );
|
||||
this.$textarea.textSelection( 'setContents', newWikitext );
|
||||
};
|
||||
|
||||
/* global ve */
|
||||
|
|
Loading…
Reference in a new issue