Created
May 3, 2013 04:06
-
-
Save tylersticka/5507143 to your computer and use it in GitHub Desktop.
Rough transitionEnd binding for Knockout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sample usage: | |
* <div data-bind="transitionEnd: modelMethod"></div> | |
* | |
* Issues: | |
* - Webkit-only event name | |
* - Fires multiple times when multiple properties are transitioned | |
*/ | |
ko.bindingHandlers.transitionEnd = { | |
init: function (element, valueAccessor) { | |
ko.utils.registerEventHandler(element, "webkitTransitionEnd", function (event) { | |
var callback = valueAccessor(); | |
callback(ko.dataFor(element), event); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment