Merge "Add 'element' type for toolbar tools"

This commit is contained in:
jenkins-bot 2022-02-11 21:23:49 +00:00 committed by Gerrit Code Review
commit 4a1caf3390

View file

@ -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;
}