diff --git a/gulpfile.js b/gulpfile.js index 27a268ad..16ed3256 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -157,14 +157,18 @@ gulp.task("bump", function() { .pipe(gulp.dest("./")); }); -gulp.task("release", ["bump", "compress"], function() { +gulp.task("release", ["bump", "compress"], function(done) { var version = argv.tag; if (!version) throw new gutil.PluginError("release", "You need to specify --tag parameter"); gulp.src(["./*.json", "./dist/*.js"]) .pipe(git.commit("version " + version)) - .pipe(git.push()) .pipe(filter("package.json")) - .pipe(tag_version()); + .pipe(tag_version()) + .on("end", function() { + git.push("origin", "master", {}, function() { + git.push("origin", "master", {args: "--tags"}, done); + }); + }); }); diff --git a/src/element/matches.js b/src/element/matches.js index 432e6fb3..dc5175a5 100644 --- a/src/element/matches.js +++ b/src/element/matches.js @@ -19,7 +19,7 @@ _.register({ var checker = HOOK[selector] || SelectorMatcher(selector); - return !!checker(this[0], this); + return !!checker(this[0]); } }, () => { return () => false; diff --git a/src/element/visibility.js b/src/element/visibility.js index 18ee00da..a6183acd 100644 --- a/src/element/visibility.js +++ b/src/element/visibility.js @@ -56,7 +56,7 @@ var TRANSITION_EVENT_TYPE = WEBKIT_PREFIX ? "webkitTransitionEnd" : "transitione eventType = animationName ? ANIMATION_EVENT_TYPE : TRANSITION_EVENT_TYPE; if (typeof hiding !== "boolean") { - hiding = !HOOK[":hidden"](node); + hiding = !HOOK[":hidden"](node, computed); } if (animationHandler) { diff --git a/src/util/animationhandler.js b/src/util/animationhandler.js index bedfa8c8..90ae11a3 100644 --- a/src/util/animationhandler.js +++ b/src/util/animationhandler.js @@ -9,7 +9,7 @@ var TRANSITION_PROPS = ["timing-function", "property", "duration", "delay"].map( }, calcTransitionDuration = (transitionValues) => { var delays = transitionValues[3], - durations = transitionValues[1]; + durations = transitionValues[2]; return Math.max.apply(Math, durations.map((value, index) => { return parseTimeValue(value) + (parseTimeValue(delays[index]) || 0); @@ -41,7 +41,7 @@ export default (node, computed, animationName, hiding, done) => { } else { var transitionValues = TRANSITION_PROPS.map((prop, index) => { // have to use regexp to split transition-timing-function value - return CSS.get[prop](computed).split(index === 2 ? /, (?!\d)/ : ", "); + return CSS.get[prop](computed).split(index ? ", " : /, (?!\d)/); }); duration = calcTransitionDuration(transitionValues); @@ -50,14 +50,15 @@ export default (node, computed, animationName, hiding, done) => { if (transitionValues[1].indexOf("all") < 0) { // try to find existing or use 0s length or make a new visibility transition - var visibilityTransitionIndex = transitionValues[1].indexOf("visibility"); - if (visibilityTransitionIndex < 0) visibilityTransitionIndex = transitionValues[2].indexOf("0s"); - if (visibilityTransitionIndex < 0) visibilityTransitionIndex = transitionValues[1].length; - - transitionValues[0][visibilityTransitionIndex] = "linear"; - transitionValues[1][visibilityTransitionIndex] = "visibility"; - transitionValues[hiding ? 2 : 3][visibilityTransitionIndex] = "0s"; - transitionValues[hiding ? 3 : 2][visibilityTransitionIndex] = duration + "ms"; + var visibilityIndex = transitionValues[1].indexOf("visibility"); + + if (visibilityIndex < 0) visibilityIndex = transitionValues[2].indexOf("0s"); + if (visibilityIndex < 0) visibilityIndex = transitionValues[1].length; + + transitionValues[0][visibilityIndex] = "linear"; + transitionValues[1][visibilityIndex] = "visibility"; + transitionValues[hiding ? 2 : 3][visibilityIndex] = "0s"; + transitionValues[hiding ? 3 : 2][visibilityIndex] = duration + "ms"; } rules = transitionValues.map((props, index) => { diff --git a/src/util/selectorhooks.js b/src/util/selectorhooks.js index 20d08d2c..ff20366d 100644 --- a/src/util/selectorhooks.js +++ b/src/util/selectorhooks.js @@ -5,14 +5,14 @@ var hooks = {}; hooks[":focus"] = (node) => node === DOCUMENT.activeElement; -hooks[":hidden"] = (node) => { +hooks[":hidden"] = (node, computed) => { if (node.getAttribute("aria-hidden") === "true") return true; - var computed = _.computeStyle(node); + computed = computed || _.computeStyle(node); return computed.visibility === "hidden" || computed.display === "none"; }; -hooks[":visible"] = (node) => !hooks[":hidden"](node); +hooks[":visible"] = (node, computed) => !hooks[":hidden"](node, computed); export default hooks;