MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 630: Line 630:
     processEventCards(cardSelector);
     processEventCards(cardSelector);
     updateViews(cardSelector);
     updateViews(cardSelector);
    updatePrintSelectionUI();


     console.log("Filtering process complete, updated views and borders");
     console.log("Filtering process complete, updated views and borders");
Line 715: Line 716:
     processEventCards();
     processEventCards();
     updateViews();
     updateViews();
    updatePrintSelectionUI();
   });
   });


Line 1,260: Line 1,262:
   });
   });


  // HERE SHOULD BE THE NEW CODE!!!!
   /* ---------- Softwear PRINT ---------- */
   /* ---------- Softwear PRINT (scoped, ES5-safe) ---------- */


   /* helpers */
   /* helpers */
Line 1,317: Line 1,318:
     jQuery("#print-chooser").hide();
     jQuery("#print-chooser").hide();
     jQuery("#show-article").removeClass("print-opts-open");
     jQuery("#show-article").removeClass("print-opts-open");
  }
  function updatePrintSelectionUI() {
    var hasActiveFilters = jQuery("#filters .values button.active").length > 0;
    var visibleCards = jQuery(".list-container .card:visible").not(".event").length;
    if (hasActiveFilters && visibleCards > 0) {
        jQuery("#print-selection-wrapper").show();
    } else {
        jQuery("#print-selection-wrapper").hide();
        jQuery("#print-selection-options").hide();
    }
   }
   }


Line 1,413: Line 1,426:
     })();
     })();


     // OPTIONAL: glue label + body together (extra safety vs. page breaks)
     // Glue label + body together (extra safety vs. page breaks)
     (function () {
     (function () {
       var style = doc.createElement("style");
       var style = doc.createElement("style");
Line 2,008: Line 2,021:
     }
     }
   });
   });
  updatePrintSelectionUI();
});
});

Navigation menu