User:Canadabonk/common.js: Difference between revisions
Content added Content deleted
Canadabonk (talk | contribs) mNo edit summary |
Canadabonk (talk | contribs) No edit summary |
||
Line 227: | Line 227: | ||
} // end hide rail ------------------------------------------------------------------------------------------------------ |
} // end hide rail ------------------------------------------------------------------------------------------------------ |
||
// toolbar dropups ----------------------------------------------------------------------------- |
|||
const toolbar = $('#cosmos-toolbar .cosmos-tools-list > ul'); |
|||
toolbar.find('[id=t-createredirect]').eq(1).remove(); // remove 2nd "create redirect" in toolbar. this shows up for some reason idk why |
|||
toolbar.append('<li id="ct-toolbar-pagetools" class="toolbar-dropup">Page tools<ul></ul></li>'); |
|||
toolbar.append('<li id="ct-toolbar-usertools" class="toolbar-dropup">User tools<ul></ul></li>'); |
|||
toolbar.find('#t-whatlinkshere, #t-recentchangeslinked, #t-print, #t-permalink, #t-info, #t-cite, #t-urlshortener, #t-createredirect').appendTo('#ct-toolbar-pagetools > ul'); |
|||
toolbar.find('#t-contributions, #t-log, #t-emailuser, #t-mute, #t-userrights').appendTo('#ct-toolbar-usertools > ul'); |
|||
$('#ct-toolbar-pagetools > ul, #ct-toolbar-usertools > ul').hide(); |
|||
$('#ct-toolbar-pagetools').click(toolbarDropup); |
|||
$('#ct-toolbar-usertools').click(toolbarDropup); |
|||
function toolbarDropup() { |
|||
$(this).toggleClass('active'); |
|||
if ($(this).is('.active')) { |
|||
$(this).find('ul').show(); |
|||
} else { |
|||
$(this).find('ul').hide(); |
|||
} |
|||
} |
|||
} //end desktop ------------------------------------------------------------------------------------------------------ |
} //end desktop ------------------------------------------------------------------------------------------------------ |