diff --git a/dist/css/modalizer.css b/dist/css/modalizer.css index 4acc169..27d1414 100644 --- a/dist/css/modalizer.css +++ b/dist/css/modalizer.css @@ -1,6 +1,6 @@ /*! - * Modalizer.js v1.0.0 modalizerjs.jlgarridol.com - * Copyright 2011-2020 José Luis Garrido-Labrador + * Modalizer.js v1.0.1 modalizerjs.jlgarridol.com + * Copyright 2020 José Luis Garrido-Labrador * Licensed under MIT (https://github.com/jlgarridol/modalizerjs/blob/main/LICENSE) */ body { diff --git a/dist/css/modalizer.min.css b/dist/css/modalizer.min.css index b7b9cda..545a8f3 100644 --- a/dist/css/modalizer.min.css +++ b/dist/css/modalizer.min.css @@ -1,5 +1,5 @@ /*! - * Modalizer.js v1.0.0 modalizerjs.jlgarridol.com - * Copyright 2011-2020 José Luis Garrido-Labrador + * Modalizer.js v1.0.1 modalizerjs.jlgarridol.com + * Copyright 2020 José Luis Garrido-Labrador * Licensed under MIT (https://github.com/jlgarridol/modalizerjs/blob/main/LICENSE) */body{overflow-x:hidden;overflow-y:scroll!important}.modal{padding-right:0!important}.modal-backdrop.show{display:none}.MOD_supreme-container.modal-open{filter:blur(.5rem)}.modal-content{border:0!important}.modal-optionable{z-index:3000000000;background-color:rgba(0,0,0,.5);padding:0!important}.modal-optionable>.modal-dialog{--animate-duration:0.5s}.modal-optionable .modal-dialog{-webkit-transform:translate(0);-moz-transform:translate(0);transform:translate(0)}.modal-dialog.fullscreen{width:100%!important;height:100%!important;max-height:-moz-fit-content!important;min-height:-moz-fit-content!important;max-height:fit-content!important;min-height:fit-content!important;margin:0!important;padding:0!important;max-width:none!important;background-color:var(--white);opacity:1}.modal-content.fullscreen{height:auto!important;min-height:100%!important;border-radius:0!important}.modal-header.fullscreen{border-bottom:1px solid #9ea2a2!important}.modal-footer.fullscreen{border-top:1px solid #9ea2a2!important}@media (max-width:576px){.modal-dialog.fullscreen-sm{width:100%!important;height:100%!important;max-height:-moz-fit-content!important;min-height:-moz-fit-content!important;max-height:fit-content!important;min-height:fit-content!important;margin:0!important;padding:0!important;max-width:none!important}.modal-content.fullscreen-sm{height:auto!important;min-height:100%!important;max-height:100%!important;border-radius:0!important}.modal-header.fullscreen-sm{border-bottom:1px solid #9ea2a2!important}.modal-footer.fullscreen-sm{border-top:1px solid #9ea2a2!important}} \ No newline at end of file diff --git a/dist/js/modalizer.js b/dist/js/modalizer.js index ed22d2c..1e7b849 100644 --- a/dist/js/modalizer.js +++ b/dist/js/modalizer.js @@ -1,6 +1,6 @@ /*! - * Modalizer.js v1.0.0 modalizerjs.jlgarridol.com - * Copyright 2011-2020 José Luis Garrido-Labrador + * Modalizer.js v1.0.1 modalizerjs.jlgarridol.com + * Copyright 2020 José Luis Garrido-Labrador * Licensed under MIT (https://github.com/jlgarridol/modalizerjs/blob/main/LICENSE) */ @@ -151,10 +151,6 @@ if (typeof $().modal != 'function') { MOD_animate = null; }) }); - - $("#MOD_supreme-container").click(function(e){ - e.preventDefault(); - }) }); diff --git a/dist/js/modalizer.min.js b/dist/js/modalizer.min.js index 4cc8e12..2746f0d 100644 --- a/dist/js/modalizer.min.js +++ b/dist/js/modalizer.min.js @@ -1,6 +1,6 @@ /*! - * Modalizer.js v1.0.0 modalizerjs.jlgarridol.com - * Copyright 2011-2020 José Luis Garrido-Labrador + * Modalizer.js v1.0.1 modalizerjs.jlgarridol.com + * Copyright 2020 José Luis Garrido-Labrador * Licensed under MIT (https://github.com/jlgarridol/modalizerjs/blob/main/LICENSE) */ -let MOD_howManyModals=0,MOD_modalz=9999,MOD_animate="",MOD_oc=null,MOD_optionable=null,MOD_actioned=!1;function boostrapAnimation(modal,animation){var cls=modal.attr("class").split(" ");cls.pop(),cls.push("animate__"+animation),modal.attr("class",cls.join(" "))}function launchModal(modal){var animation=modal.data("animate-in")||null;null!=animation&&modal.addClass("animate__"+animation),modal.hasClass("show")?(modal.removeClass("show"),setTimeout((function(){modal.css("z-index",++MOD_modalz),modal.addClass("show")}),500)):(setCurrentModal(modal),modal.hasClass("modal-optionable")||MOD_howManyModals++,modal.modal("show")),modal.css("display","block"),setTimeout((function(){null!=animation&&modal.removeClass("animate__"+animation)}),1e3),$("#MOD_supreme-container").addClass("modal-open")}function resetmodals(){let curmodal;MOD_CURRENTMODAL.pop().modal("hide")}function afterresetmodal(curmodal){let stack=eval(curmodal.data("stack"));null!=stack&&stack.clean();let loop=0,anim=curmodal.data("animate-in")||null;curmodal.children("div").each((function(){let modal=$(this);boostrapAnimation(modal,"fadeInRight"),0==loop?(modal.css("display",""),null!=anim&&boostrapAnimation(modal,anim)):modal.css("display","none"),loop++}))}function setCurrentModal(modal){MOD_CURRENTMODAL.push(modal)}"function"!=typeof $().modal?console.error("Bootstrap modals not loaded"):$(document).ready((function(){$(".modalinit").each((function(){$(this).click((function(){let btn=$(this),modal=$("#"+btn.data("modal"));0!=modal.length&&launchModal(modal)}))})),$(".nextaction").each((function(){$(this).click((function(){let btn=$(this),stack=eval(MOD_CURRENTMODAL.peek().data("stack")),nexttext=btn.data("next")||"",dialog=btn.closest("div.modal-dialog");MOD_optionable={dialog:dialog,nexttext:nexttext,stack:stack,next:!0},MOD_actioned=!0,boostrapAnimation(dialog,"fadeOutLeftBig")}))})),$(".beforeaction").each((function(){$(this).click((function(){let btn=$(this),stack=eval(MOD_CURRENTMODAL.peek().data("stack")),before=stack.pop(),dialog=btn.closest("div.modal-dialog");MOD_optionable={before:before,dialog:dialog,next:!1},MOD_actioned=!0,boostrapAnimation(dialog,"fadeOutRightBig")}))})),$(".modal-dialog.animate__animated").each((function(){$(this).on("animationend",(function(e){if(null!=MOD_optionable&&MOD_actioned)if(MOD_actioned=!1,MOD_optionable.dialog.hide(),MOD_optionable.next)if(MOD_optionable.stack.push(MOD_optionable.dialog.attr("id")),""!=MOD_optionable.nexttext){let next=$("#"+MOD_optionable.nexttext);boostrapAnimation(next,"fadeInRightBig"),next.show()}else resetmodals();else if(null!=MOD_optionable.before){let before=$("#"+MOD_optionable.before);boostrapAnimation(before,"fadeInLeftBig"),before.show()}else MOD_optionable.dialog.show(),resetmodals()}))})),$(".modal.modalizer").each((function(){$(this).on("show.bs.modal",(function(){let it=$(this);it.hasClass("modal-optionable")||($("#MOD_supreme-container").addClass("modal-open"),it.css("z-index",++MOD_modalz))})),$(this).on("hide.bs.modal",(function(e){e.preventDefault();let it=$(this);var animation=it.data("animate-out")||null;null!=animation&&it.addClass("animate__"+animation),MOD_animate=animation,MOD_oc=it,it.removeClass("show"),MOD_modalz--,$('.modal[style*="display: block"]').length>1?$("#MOD_supreme-container").addClass("modal-open"):($("#MOD_supreme-container").removeClass("modal-open"),$("body").removeClass("modal-open"))}))})),$(".closemodal").each((function(){$(this).click((function(){let modal;$(this).closest("div.modal").modal("hide"),resetmodals()}))})),$(".modal.modalizer.animate__animated").each((function(){$(this).on("animationend",(function(e){let it=$(this);null!=MOD_animate&&it.removeClass("animate__"+MOD_animate),null!=MOD_oc&&(MOD_oc.css("display","none"),MOD_oc.hasClass("modal-optionable")&&afterresetmodal(MOD_oc)),MOD_oc=null,MOD_animate=null}))})),$("#MOD_supreme-container").click((function(e){e.preventDefault()}))}));class MOD_Stack{constructor(){this.items=[]}push(element){this.items.push(element)}pop(){return this.isEmpty()?null:this.items.pop()}peek(){return this.items[this.items.length-1]}isEmpty(){return 0==this.items.length}clean(){this.items=[]}}function removeItemOnce(arr,value){var index=arr.indexOf(value);return index>-1&&arr.splice(index,1),arr}const MOD_CURRENTMODAL=new MOD_Stack; \ No newline at end of file +let MOD_howManyModals=0,MOD_modalz=9999,MOD_animate="",MOD_oc=null,MOD_optionable=null,MOD_actioned=!1;function boostrapAnimation(modal,animation){var cls=modal.attr("class").split(" ");cls.pop(),cls.push("animate__"+animation),modal.attr("class",cls.join(" "))}function launchModal(modal){var animation=modal.data("animate-in")||null;null!=animation&&modal.addClass("animate__"+animation),modal.hasClass("show")?(modal.removeClass("show"),setTimeout((function(){modal.css("z-index",++MOD_modalz),modal.addClass("show")}),500)):(setCurrentModal(modal),modal.hasClass("modal-optionable")||MOD_howManyModals++,modal.modal("show")),modal.css("display","block"),setTimeout((function(){null!=animation&&modal.removeClass("animate__"+animation)}),1e3),$("#MOD_supreme-container").addClass("modal-open")}function resetmodals(){let curmodal;MOD_CURRENTMODAL.pop().modal("hide")}function afterresetmodal(curmodal){let stack=eval(curmodal.data("stack"));null!=stack&&stack.clean();let loop=0,anim=curmodal.data("animate-in")||null;curmodal.children("div").each((function(){let modal=$(this);boostrapAnimation(modal,"fadeInRight"),0==loop?(modal.css("display",""),null!=anim&&boostrapAnimation(modal,anim)):modal.css("display","none"),loop++}))}function setCurrentModal(modal){MOD_CURRENTMODAL.push(modal)}"function"!=typeof $().modal?console.error("Bootstrap modals not loaded"):$(document).ready((function(){$(".modalinit").each((function(){$(this).click((function(){let btn=$(this),modal=$("#"+btn.data("modal"));0!=modal.length&&launchModal(modal)}))})),$(".nextaction").each((function(){$(this).click((function(){let btn=$(this),stack=eval(MOD_CURRENTMODAL.peek().data("stack")),nexttext=btn.data("next")||"",dialog=btn.closest("div.modal-dialog");MOD_optionable={dialog:dialog,nexttext:nexttext,stack:stack,next:!0},MOD_actioned=!0,boostrapAnimation(dialog,"fadeOutLeftBig")}))})),$(".beforeaction").each((function(){$(this).click((function(){let btn=$(this),stack=eval(MOD_CURRENTMODAL.peek().data("stack")),before=stack.pop(),dialog=btn.closest("div.modal-dialog");MOD_optionable={before:before,dialog:dialog,next:!1},MOD_actioned=!0,boostrapAnimation(dialog,"fadeOutRightBig")}))})),$(".modal-dialog.animate__animated").each((function(){$(this).on("animationend",(function(e){if(null!=MOD_optionable&&MOD_actioned)if(MOD_actioned=!1,MOD_optionable.dialog.hide(),MOD_optionable.next)if(MOD_optionable.stack.push(MOD_optionable.dialog.attr("id")),""!=MOD_optionable.nexttext){let next=$("#"+MOD_optionable.nexttext);boostrapAnimation(next,"fadeInRightBig"),next.show()}else resetmodals();else if(null!=MOD_optionable.before){let before=$("#"+MOD_optionable.before);boostrapAnimation(before,"fadeInLeftBig"),before.show()}else MOD_optionable.dialog.show(),resetmodals()}))})),$(".modal.modalizer").each((function(){$(this).on("show.bs.modal",(function(){let it=$(this);it.hasClass("modal-optionable")||($("#MOD_supreme-container").addClass("modal-open"),it.css("z-index",++MOD_modalz))})),$(this).on("hide.bs.modal",(function(e){e.preventDefault();let it=$(this);var animation=it.data("animate-out")||null;null!=animation&&it.addClass("animate__"+animation),MOD_animate=animation,MOD_oc=it,it.removeClass("show"),MOD_modalz--,$('.modal[style*="display: block"]').length>1?$("#MOD_supreme-container").addClass("modal-open"):($("#MOD_supreme-container").removeClass("modal-open"),$("body").removeClass("modal-open"))}))})),$(".closemodal").each((function(){$(this).click((function(){let modal;$(this).closest("div.modal").modal("hide"),resetmodals()}))})),$(".modal.modalizer.animate__animated").each((function(){$(this).on("animationend",(function(e){let it=$(this);null!=MOD_animate&&it.removeClass("animate__"+MOD_animate),null!=MOD_oc&&(MOD_oc.css("display","none"),MOD_oc.hasClass("modal-optionable")&&afterresetmodal(MOD_oc)),MOD_oc=null,MOD_animate=null}))}))}));class MOD_Stack{constructor(){this.items=[]}push(element){this.items.push(element)}pop(){return this.isEmpty()?null:this.items.pop()}peek(){return this.items[this.items.length-1]}isEmpty(){return 0==this.items.length}clean(){this.items=[]}}function removeItemOnce(arr,value){var index=arr.indexOf(value);return index>-1&&arr.splice(index,1),arr}const MOD_CURRENTMODAL=new MOD_Stack; \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index af81e73..30b5ed5 100644 --- a/doc/index.html +++ b/doc/index.html @@ -41,7 +41,7 @@
Lightweight extension over bootstrap's modals to improve of the control, animations and visualization of modal windows.
Licensed under MIT, created by José Luis Garrido-Labrador

-

See it on GitHub

+

See it on GitHub


@@ -100,7 +100,7 @@

Installation

Via npm

-
$ npm install modalizer.js
+
$ npm install @jlgarridol/modalizer.js@1.0.0

or add it directly using a CDN:

<link rel="stylesheet" href="https://future/modalizer.min.css"/>
 <script src="https://future/modalizer.min.js"></script>
@@ -271,9 +271,9 @@
-