mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-14 19:31:55 +00:00
Merge "Add 'element' type for toolbar tools"
This commit is contained in:
commit
4a1caf3390
|
@ -428,6 +428,16 @@
|
|||
);
|
||||
$select.append( $( '<div>' ).addClass( 'menu' ).append( $options ) );
|
||||
return $select;
|
||||
case 'element':
|
||||
// A raw 'element' type can be {htmlString|Element|Text|Array|jQuery|OO.ui.HTMLSnippet}.
|
||||
var $element = $( '<div>' )
|
||||
.attr( { rel: id, class: 'tool tool-element' } );
|
||||
if ( tool.element instanceof OO.ui.HtmlSnippet ) {
|
||||
$element.append( tool.element.toString() );
|
||||
} else {
|
||||
$element.append( tool.element );
|
||||
}
|
||||
return $element;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue