Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* CustomHeaderDropdown
*
* Lets you customize the dropdown on the community header next to the wiki activity
*
* @author Dorumin
*/
(function() {
if (
window.CustomHeaderDropdown && CustomHeaderDropdown.init
) return;
window.CustomHeaderDropdown = $.extend({
links: window.CustomHeaderLinks,
$buttons: $('.wds-community-header__wiki-buttons, .wiki-tools'),
buildDropdown: function(links) {
var $dropdown = $('<ul>', {
'class': 'wds-list wds-is-linked'
});
links.forEach(function(link) {
$('<li>', {
append: $('<a>', link)
}).appendTo($dropdown);
});
return $dropdown;
},
replaceDropdown: function($new) {
this.$buttons.find('ul').replaceWith($new);
},
init: function() {
if (!this.links) return;
this.replaceDropdown(this.buildDropdown(this.links));
}
}, window.CustomHeaderDropdown);
CustomHeaderDropdown.init();
})();