MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1,873: Line 1,873:
         e.preventDefault();
         e.preventDefault();


        console.log("PRINT BUTTON CLICKED");
         var borderPref = jQuery(this).hasClass("print-selection-no-border")
 
         var $btn = jQuery(this);
 
        var borderPref = $btn.hasClass("print-selection-no-border")
         ? "without"
         ? "without"
         : "with";
         : "with";


        var originalText = $btn.text();
        $btn.text("[PREPARING]");
        $btn.prop("disabled", true);
        // 👇 force repaint
        $btn[0].offsetHeight;
        // 👇 delay EVERYTHING that hides or blocks UI
        setTimeout(function () {
        hidePrintSelectionOptions();
         swHandleBatchPrint(borderPref);
         swHandleBatchPrint(borderPref);
        $btn.text(originalText);
        $btn.prop("disabled", false);
        }, 400);
     }
     }
   );
   );

Navigation menu