mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Allow for mw.body being null in <selfclosing/> extensions
Bug: T173016 Change-Id: I8daa65e5dc0368b366710f044b621287e83e26f7
This commit is contained in:
parent
21759ac8c9
commit
51207e7aa5
|
@ -75,14 +75,16 @@ ve.ui.MWExtensionWindow.prototype.getInputPlaceholder = function () {
|
||||||
ve.ui.MWExtensionWindow.prototype.getSetupProcess = function ( data, process ) {
|
ve.ui.MWExtensionWindow.prototype.getSetupProcess = function ( data, process ) {
|
||||||
data = data || {};
|
data = data || {};
|
||||||
return process.next( function () {
|
return process.next( function () {
|
||||||
var dir;
|
var dir, mwData;
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
this.whitespace = [ '', '' ];
|
this.whitespace = [ '', '' ];
|
||||||
|
|
||||||
if ( this.selectedNode ) {
|
if ( this.selectedNode ) {
|
||||||
this.input.setValueAndWhitespace( this.selectedNode.getAttribute( 'mw' ).body.extsrc );
|
mwData = this.selectedNode.getAttribute( 'mw' );
|
||||||
this.originalMwData = this.selectedNode.getAttribute( 'mw' );
|
// mwData.body can be null in <selfclosing/> extensions
|
||||||
|
this.input.setValueAndWhitespace( mwData.body && mwData.body.extsrc );
|
||||||
|
this.originalMwData = mwData;
|
||||||
} else {
|
} else {
|
||||||
if ( !this.constructor.static.modelClasses[ 0 ].static.isContent ) {
|
if ( !this.constructor.static.modelClasses[ 0 ].static.isContent ) {
|
||||||
// New nodes should use linebreaks for blocks
|
// New nodes should use linebreaks for blocks
|
||||||
|
|
Loading…
Reference in a new issue