Preserve pre-existing css classes on edit tab link

Follows-up Ib2e6237483338c8.

Note that the potentially dangling space is cleaned up by the
Html class in MediaWiki which recognises this as a space-separated
attribute. It also supports an actual array, if MediaWiki core
were to expose 'class' as an array, we could just cleanly push an
extra into it (as well as easily removing items). But this hook
maintains this array item as a string for backwards compatibility
with hook listeners that expect a string.

Bug: 64646
Change-Id: Ib74ecf93fc4fc4bbb1af43efdf325edc7fb2d85f
This commit is contained in:
Timo Tijhof 2014-04-30 15:01:59 +02:00 committed by Krinkle
parent 3b3a66763a
commit 2364e35ad5

View file

@ -114,11 +114,11 @@ class VisualEditorHooks {
// Inject the VE tab before or after the edit tab
if ( $wgVisualEditorTabPosition === 'before' ) {
$editTab['class'] = 'collapsible';
$editTab['class'] .= ' collapsible';
$newViews['ve-edit'] = $veTab;
$newViews['edit'] = $editTab;
} else {
$veTab['class'] = 'collapsible';
$veTab['class'] .= ' collapsible';
$newViews['edit'] = $editTab;
$newViews['ve-edit'] = $veTab;
}