Difference between revisions of "MediaWiki:Common.js"

From Animation Luzern Wiki
Line 1: Line 1:
 
/* Change the upload Link */
 
/* Change the upload Link */
 
$( function () {
 
$( function () {
$( '#t-upload a' ).attr("href", "/index.php?title=Special:BatchUpload");
+
  $( '#t-upload a' ).attr("href", "/index.php?title=Special:BatchUpload");
} );
+
 
 +
    /* Open menus on mouse over, don't do anything on touch-devices. */
 +
 
 +
    window.IsTouchDevice = false;
 +
    window.addEventListener('touchstart', function onFirstTouch() {
 +
        window.IsTouchDevice = true;
 +
        window.removeEventListener('touchstart', onFirstTouch, false);
 +
    }, false);
 +
 
 +
    $(".dropdown").hover(
 +
            function(){ if (!window.IsTouchDevice) $(this).addClass('open'); },
 +
            function(){ if (!window.IsTouchDevice) $(this).removeClass('open'); }
 +
    );
 +
});

Revision as of 00:54, 17 January 2018

/* Change the upload Link */
$( function () {
  $( '#t-upload a' ).attr("href", "/index.php?title=Special:BatchUpload");

    /* Open menus on mouse over, don't do anything on touch-devices. */

    window.IsTouchDevice = false;
    window.addEventListener('touchstart', function onFirstTouch() {
        window.IsTouchDevice = true;
        window.removeEventListener('touchstart', onFirstTouch, false);
    }, false);

    $(".dropdown").hover(
            function(){ if (!window.IsTouchDevice) $(this).addClass('open'); },
            function(){ if (!window.IsTouchDevice) $(this).removeClass('open'); }
    );
});