Add class to div wrapper around category lists
authorEd Sanders <esanders@wikimedia.org>
Fri, 29 Apr 2016 21:30:57 +0000 (22:30 +0100)
committerEd Sanders <esanders@wikimedia.org>
Fri, 29 Apr 2016 21:30:57 +0000 (22:30 +0100)
Allows VE to target non-editable content to keep on the page.

Change-Id: If687b84d9ad33a0315a8ba4260bc3532691f05ed

includes/CategoryViewer.php

index f749003..389b077 100644 (file)
@@ -138,9 +138,13 @@ class CategoryViewer extends ContextSource {
                }
 
                $lang = $this->getLanguage();
-               $langAttribs = [ 'lang' => $lang->getHtmlCode(), 'dir' => $lang->getDir() ];
+               $attribs = [
+                       'class' => 'mw-category-generated',
+                       'lang' => $lang->getHtmlCode(),
+                       'dir' => $lang->getDir()
+               ];
                # put a div around the headings which are in the user language
-               $r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
+               $r = Html::openElement( 'div', $attribs ) . $r . '</div>';
 
                return $r;
        }