mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Don't do evil shadowing of mw
Having local variable called mw that shadows the global variable mw is evil. Rename it to mwAttr. Change-Id: I87bd3698c73608076424c10fdb0559dfdc3e3045
This commit is contained in:
parent
23595970fe
commit
cba55b9330
|
@ -57,7 +57,7 @@ ve.dm.MWReferenceNode.static.toDataElement = function ( domElements, converter )
|
||||||
};
|
};
|
||||||
|
|
||||||
ve.dm.MWReferenceNode.static.toDomElements = function ( dataElement, doc, converter ) {
|
ve.dm.MWReferenceNode.static.toDomElements = function ( dataElement, doc, converter ) {
|
||||||
var itemNodeHtml, mw,
|
var itemNodeHtml, mwAttr,
|
||||||
span = doc.createElement( 'span' ),
|
span = doc.createElement( 'span' ),
|
||||||
itemNodeWrapper = doc.createElement( 'div' ),
|
itemNodeWrapper = doc.createElement( 'div' ),
|
||||||
itemNode = converter.internalList.getItemNode( dataElement.attributes.listIndex ),
|
itemNode = converter.internalList.getItemNode( dataElement.attributes.listIndex ),
|
||||||
|
@ -72,9 +72,9 @@ ve.dm.MWReferenceNode.static.toDomElements = function ( dataElement, doc, conver
|
||||||
),
|
),
|
||||||
itemNodeHtml = $( itemNodeWrapper ).html();
|
itemNodeHtml = $( itemNodeWrapper ).html();
|
||||||
|
|
||||||
mw = ( dataElement.attributes && ve.copyObject( dataElement.attributes.mw ) ) || {};
|
mwAttr = ( dataElement.attributes && ve.copyObject( dataElement.attributes.mw ) ) || {};
|
||||||
ve.setProp( mw, 'body', 'html', itemNodeHtml );
|
ve.setProp( mwAttr, 'body', 'html', itemNodeHtml );
|
||||||
span.setAttribute( 'data-mw', JSON.stringify( mw ) );
|
span.setAttribute( 'data-mw', JSON.stringify( mwAttr ) );
|
||||||
|
|
||||||
return [ span ];
|
return [ span ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue