Comparing version 1.2.2 to 1.2.3
/* | ||
https://github.com/leeoniya/domvm (1.2.2) | ||
https://github.com/leeoniya/domvm (1.2.3) | ||
*/ | ||
@@ -34,3 +34,3 @@ ("undefined"!==typeof global?global:this).domvm={};(function(x){var r=("undefined"==typeof window?{}:window).requestAnimationFrame,w={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,counterIncrement:!0,fillOpacity:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,"float":!0,fontWeight:!0,gridColumn:!0,lineHeight:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0,tabSize:!0,transform:!0,transformOrigin:!0,widows:!0,zIndex:!0,zoom:!0},f={TYPE_ELEM:1, | ||
a=null,m="";x.route=function(u,x){function p(){var a=location,a=d?a.href.substr(a.origin.length):a.hash.substr(1)||"/";return r(B,m,a)}var C=null,D={href:function(a,c,f,n,p){var v=r(B,m,a,c,f,n);return d?(a=function(a){D["goto"](v,null,null,null,p);a.preventDefault()},a.href=v.href,a):"#"+v.href},config:function(c){(d=c.useHist)&&(m=c.root||"");n=c.willEnter||null;a=c.willExit||null;C=c.init||null},refresh:function(){D["goto"](p(),null,null,null,!0)},"goto":function(h,p,u,y,x){h.href||(h=r(B,m,h, | ||
p,u,y));if(!1===h.name)console.log("Could not find route");else{p=null;for(y=0;y<f.length;y++)if(f[y].href===h.href){p=y;break}null===p&&(f.splice(c+1,1E4),f.push(h),p=f.length-1);h=f[c];y=f[p];var w=!0;u=!0;null!==c&&(a&&(w=!1!==a(h,y)),w&&(w=(w=B[h.name].onexit)?w.apply(null,(h?[h.segs,h.query,h.hash]:[]).concat(y)):!0));!1!==w&&(n&&(u=!1!==n(y,h)),u&&(u=B[y.name].onenter.apply(null,(y?[y.segs,y.query,y.hash]:[]).concat(h))),u&&(d?(v=!0,history[x?"replaceState":"pushState"](null,"title",y.href)): | ||
p,u,y));if(!1===h.name)console.log("Could not find route");else{p=null;for(y=0;y<f.length;y++)if(f[y].href===h.href){p=y;break}null===p&&(f.splice(c+1,1E4),f.push(h),p=f.length-1);h=f[c];y=f[p];var w=!0;u=!0;null!==c&&(a&&(w=a(h,y)),!1!==w&&(w=(w=B[h.name].onexit)?w.apply(null,(h?[h.segs,h.query,h.hash]:[]).concat(y)):!0));!1!==w&&(n&&(u=n(y,h)),!1!==u&&(u=B[y.name].onenter.apply(null,(y?[y.segs,y.query,y.hash]:[]).concat(h))),!1!==u&&(d?(v=!0,history[x?"replaceState":"pushState"](null,"title",y.href)): | ||
(y="#"+y.href,location.hash!==y&&(v=!0,x?location.replace(y):location.hash=y)),c=p))}},location:function(){return null==c?p():f[c]}},B=u(D,x);w(B,m);var v=!1;window.onhashchange=window.onpopstate=function(a){if(d||"popstate"!=a.type)!d&&v?v=!1:D["goto"](p(),null,null,null,!0)};C&&C();return D}})(domvm); |
@@ -7,3 +7,3 @@ { | ||
"author": "Leon Sorokin <leeoniya@gmail.com>", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"main": "index.js", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -82,5 +82,5 @@ (function(domvm) { | ||
if (willExit) | ||
canExit = willExit(prev, next) !== false; | ||
canExit = willExit(prev, next); | ||
if (canExit) { | ||
if (canExit !== false) { | ||
var onexit = routes[prev.name].onexit; | ||
@@ -96,5 +96,5 @@ canExit = !onexit ? true : onexit.apply(null, (prev ? [prev.segs, prev.query, prev.hash] : []).concat(next)); | ||
if (willEnter) | ||
canEnter = willEnter(next, prev) !== false; | ||
canEnter = willEnter(next, prev); | ||
if (canEnter) { | ||
if (canEnter !== false) { | ||
var onenter = routes[next.name].onenter; | ||
@@ -104,3 +104,3 @@ canEnter = onenter.apply(null, (next ? [next.segs, next.query, next.hash] : []).concat(prev)); | ||
if (canEnter) { | ||
if (canEnter !== false) { | ||
if (useHist) { | ||
@@ -107,0 +107,0 @@ gotoLocChg = true; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
868346