Sha256: edba106f807efee24e2f9615b24a5356e76d5757e00e86fe4a7565c2d0b7675d
Contents?: true
Size: 1.17 KB
Versions: 18
Compression:
Stored size: 1.17 KB
Contents
// To initially hide the patient menu on a page, add the class "collapse-patient-menu" to // the body. However the menu will re-show on browser window resize unless you also add the // bosy class "always-collapse-patient-menu". // Example usage in a slim view e.g MDM show: // - content_for(:body_class) { "collapse-patient-menu always-collapse-patient-menu" } // $(document).ready(function() { $("body").on("click", ".patient-menu-toggler", function(e) { $("body").toggleClass("collapse-patient-menu") .last().one('transitionend', triggerMasonryLayoutRefresh); }) function triggerMasonryLayoutRefresh() { $('.mgrid > .row').masonry('layout'); } function showHidePatientMenuAccordingToScreenSize() { if (!$("body").hasClass("always-collapse-patient-menu")) { if (isMobileWidth()) { $("body").addClass("collapse-patient-menu") } else { $("body").removeClass("collapse-patient-menu") } } setTimeout(triggerMasonryLayoutRefresh, 300); } function isMobileWidth() { return $('#screen-is-mobile-size').is(':visible'); } $(window).bind("resize", _.debounce(showHidePatientMenuAccordingToScreenSize, 200)); });
Version data entries
18 entries across 18 versions & 1 rubygems