lib/generators/pakyow/app/templates/public/scripts/ring/components/modal.min.js in pakyow-0.10.1 vs lib/generators/pakyow/app/templates/public/scripts/ring/components/modal.min.js in pakyow-0.10.2

- old
+ new

@@ -1 +1 @@ -pw.component.register("modal",function(n,t,e,i){var o,a,d=this,c="modal:"+i;this.listen(c+":navigator:enter",function(n){o||(o=document.createElement("DIV"),o.classList.add("ui-modal-blinder"),a=document.createElement("DIV"),a.classList.add("ui-modal"),o.appendChild(a),document.body.appendChild(o),o.addEventListener("click",function(n){if(n.target===o){n.preventDefault(),d.close();var t=window.location.pathname,e={uri:t};window.history.pushState(e,t,t)}})),a.innerHTML=n.body,pw.component.findAndInit(o),o.classList.add("ui-appear")}),this.listen(c+":navigator:exit",function(){console.log("exit"),d.close()}),this.listen(c+":navigator:boot",function(n){d.load(n)}),n.node.addEventListener("click",function(n){return n.preventDefault(),d.load(this.href),!1}),this.load=function(n){if(!window.socket)return void(document.location=n);var e={uri:n,context:"modal:"+i};t.container&&(e.container=t.container),window.history.pushState(e,n,n)},this.close=function(){pw.node.remove(o),o=null,a=null}}); +pw.component.register("modal",function(t,e,n,o){var a,i,d,l=this,r="modal:"+o;(d=document.querySelector('*[data-template="ui-modal-blinder"]'))&&(d=d.cloneNode(!0)),this.listen(r+":navigator:enter",function(t){a||(d?(a=d.cloneNode(!0),i=a.querySelector('*[data-template="ui-modal-content"]'),document.body.appendChild(a),a.removeAttribute("data-template"),i.removeAttribute("data-template")):(a=document.createElement("DIV"),a.classList.add("ui-modal-blinder"),i=document.createElement("DIV"),i.classList.add("ui-modal"),a.appendChild(i),document.body.appendChild(a)),a.addEventListener("click",function(t){if(t.target===a){t.preventDefault(),l.close();var e=window.location.pathname,n={uri:e};window.history.pushState(n,e,e)}})),i.innerHTML=t.body,pw.component.findAndInit(a),a.classList.add("ui-appear")}),this.listen(r+":navigator:exit",function(){l.close()}),this.listen(r+":navigator:boot",function(t){l.load(t)}),t.node.addEventListener("click",function(t){return t.preventDefault(),l.load(this.href),!1}),this.load=function(t){if(!window.socket)return void(document.location=t);var n={uri:t,context:"modal:"+o};e.container&&(n.container=e.container),e.partial&&(n.partial=e.partial),window.history.pushState(n,t,t)},this.close=function(){a&&i&&(pw.node.remove(a),a=null,i=null)}});