mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 09:26:37 +00:00
MWTableNode: Apply wikitable class to pasted tables
Bug: T85577 Change-Id: I9714cf3e8ccc165f91af939481c845c3ec9c5f6b
This commit is contained in:
parent
3bc62ba61d
commit
bf50e2a570
|
@ -44,13 +44,18 @@ ve.dm.TableSectionNode.static.parentNodeTypes.push( 'mwTable' );
|
|||
ve.dm.TableCaptionNode.static.parentNodeTypes.push( 'mwTable' );
|
||||
ve.dm.TableRowNode.static.childNodeTypes.push( 'mwTransclusionTableCell' );
|
||||
|
||||
ve.dm.MWTableNode.static.toDataElement = function ( domElements ) {
|
||||
ve.dm.MWTableNode.static.toDataElement = function ( domElements, converter ) {
|
||||
var attributes = {},
|
||||
dataElement = { type: this.name },
|
||||
classAttr = domElements[ 0 ].getAttribute( 'class' );
|
||||
|
||||
this.setClassAttributes( attributes, classAttr );
|
||||
|
||||
// Default to wikitable when pasting
|
||||
if ( converter.isFromClipboard() ) {
|
||||
attributes.wikitable = true;
|
||||
}
|
||||
|
||||
if ( !ve.isEmptyObject( attributes ) ) {
|
||||
dataElement.attributes = attributes;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue