MediaWiki:Gadget-defaultVisibilityToggles.js: Difference between revisions
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* jshint undef: true | /* jshint undef: true */ | ||
/* globals $, jQuery, mw, window, getComputedStyle */ | /* globals $, jQuery, mw, window, getComputedStyle */ | ||
| Line 99: | Line 99: | ||
navHead.style.cursor = "pointer"; | navHead.style.cursor = "pointer"; | ||
var toggleCategory = $(navFrame).data("toggle-category") || getToggleCategory(navFrame, "other boxes"); | var toggleCategory = $(navFrame).data("toggle-category") | ||
|| getToggleCategory(navFrame, "other boxes"); | |||
navHead.onclick = window.VisibilityToggles.register(toggleCategory, | navHead.onclick = window.VisibilityToggles.register(toggleCategory, | ||
function show() { | function show() { | ||
| Line 136: | Line 137: | ||
itCaption.style.cursor = "pointer"; | itCaption.style.cursor = "pointer"; | ||
var toggleCategory = $(it).data("toggle-category") || getToggleCategory(it, "other boxes"); | var toggleCategory = $(it).data("toggle-category") | ||
|| getToggleCategory(it, "other boxes"); | |||
itCaption.onclick = window.VisibilityToggles.register(toggleCategory, | itCaption.onclick = window.VisibilityToggles.register(toggleCategory, | ||
function show() { | function show() { | ||
| Line 179: | Line 181: | ||
function show() { | function show() { | ||
HQToggleButton.text(" | HQToggleButton.text("quotations ▲"); | ||
$(li).children("ul").show(); | $(li).children("ul").show(); | ||
} | } | ||
function hide() { | function hide() { | ||
HQToggleButton.text(" | HQToggleButton.text("quotations ▼"); | ||
$(li).children("ul").hide(); | $(li).children("ul").hide(); | ||
} | } | ||
| Line 287: | Line 289: | ||
// attribute or will be based on the text of the closest preceding | // attribute or will be based on the text of the closest preceding | ||
// fourth-to-sixth-level header. | // fourth-to-sixth-level header. | ||
var toggleCategory = $rootElement.data("toggle-category") || getToggleCategory($rootElement[0], "other lists"); | var toggleCategory = $rootElement.data("toggle-category") | ||
|| getToggleCategory($rootElement[0], "other lists"); | |||
// Determine the text for the $toggleButton. | // Determine the text for the $toggleButton. | ||