Difference between revisions of "Template:Sidebar"
Adelo Vieira (talk | contribs) |
Adelo Vieira (talk | contribs) |
||
Line 544: | Line 544: | ||
}); | }); | ||
− | $("#button-tools").hover(function(){ | + | $("#button-tools").hover(function() { |
$(".fa-tools").css('font-size', '19px') | $(".fa-tools").css('font-size', '19px') | ||
− | }, function(){ | + | }, function() { |
if ( $(this).hasClass("bottom-selected") ) { | if ( $(this).hasClass("bottom-selected") ) { | ||
$(".fa-tools").css('font-size', '19px') | $(".fa-tools").css('font-size', '19px') | ||
Line 555: | Line 555: | ||
function resaltarSection() { | function resaltarSection() { | ||
− | $(".mw-collapsible-text").hover(function(){ | + | $(".mw-collapsible-text, .mw-collapsible-toggle").hover(function() { |
$(this).parent().parent().children(".resaltar").first().css({'cssText':'background: red !important'}) | $(this).parent().parent().children(".resaltar").first().css({'cssText':'background: red !important'}) | ||
// $(".resaltar").first().css({'cssText':'background: red !important'}) | // $(".resaltar").first().css({'cssText':'background: red !important'}) | ||
Line 671: | Line 671: | ||
collapseSome() | collapseSome() | ||
removeCSS() | removeCSS() | ||
− | // | + | |
− | // | + | // This function involved mw-collapsible, which has some problems when adding JS functionalities. So, to make sure |
+ | // this function do what it has to do, we have to ensure that it runs when the DOM is ready. | ||
+ | // Even inside «.ready()» is not working as expected (when we refresh the page, sometimes it works, sometimes it doesn't work). | ||
+ | // So we needed to execute it after a delay: | ||
+ | setTimeout( function() { resaltarSection() }, 1000 ); | ||
}); | }); | ||
checkUser() | checkUser() | ||
collapseSome() | collapseSome() | ||
removeCSS() | removeCSS() | ||
− | + | setTimeout( function() { resaltarSection() }, 1000 ); | |
− | |||
}); | }); | ||
Line 698: | Line 701: | ||
$(document).ready( function() { | $(document).ready( function() { | ||
$('#totalItems, #enteredItems').keyup(function(){ | $('#totalItems, #enteredItems').keyup(function(){ | ||
− | setTimeout( function() { resaltarSection() }, | + | setTimeout( function() { resaltarSection() }, 1000 ); |
}); | }); | ||
− | setTimeout( function() { resaltarSection() }, | + | setTimeout( function() { resaltarSection() }, 1000 ); |
}); | }); |
Revision as of 17:37, 18 March 2021