Comparing version 0.1.0 to 0.2.0
@@ -19,3 +19,3 @@ { | ||
}, | ||
"version": "0.1.0" | ||
"version": "0.2.0" | ||
} |
@@ -55,7 +55,7 @@ # vue-utils | ||
One thing with Vue.js is that when components load in and out between routes the scroll bar doesn't change position. We most likely want to scroll to the top of the page for new (main) routes. | ||
One thing with Vue.js is that when components load in and out between routes, the scroll bar doesn't change position. We most likely want to scroll to the top of the page for new (main) routes. | ||
Once you add this it will automatically scroll to the top of the page based on a route group which can be set in your route mappings. | ||
Once set it will automatically scroll to the top of the page based on a route group which can be set in your route mappings. | ||
The default value in the routes file will be called `scrollTop` for setting groups. | ||
The default value in the routes file will be called `pageTop` for setting groups. | ||
@@ -83,2 +83,2 @@ ``` | ||
Any routes in the same `group` will NOT scroll to top. Only routes between DIFFERENT groups will scroll to the top. | ||
Any routes in the same `group` will NOT scroll to top. Only routes between DIFFERENT groups will scroll to the top (or no group set at all). |
module.exports = (function () { | ||
var _enter = null, | ||
var _outOccured = false, | ||
_enter = null, | ||
_options = null; | ||
@@ -23,4 +24,9 @@ | ||
_animateFade(el, 0, 1, done); | ||
_animateFade(el, 0, 1, function () { | ||
_outOccured = false; | ||
done(); | ||
}); | ||
}; | ||
if ( ! _outOccured) { _enter(); } | ||
} | ||
@@ -32,7 +38,12 @@ | ||
_enter = function () { | ||
_outOccured = false; | ||
el.style.display = null; | ||
}; | ||
if ( ! _outOccured) { _enter(); } | ||
} | ||
function _fadeOut(el, done) { | ||
_outOccured = true; | ||
_animateFade(el, 10, -1, function () { | ||
@@ -45,2 +56,4 @@ _enter(); | ||
function _noFadeOut(el, done) { | ||
_outOccured = true; | ||
setTimeout(function () { | ||
@@ -47,0 +60,0 @@ _enter(); |
6242
98