-
-
Save EdwardIII/5213602 to your computer and use it in GitHub Desktop.
This file contains 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
ko.bindingHandlers.slideVisible = { | |
init: function(element, valueAccessor) { | |
var value = ko.utils.unwrapObservable(valueAccessor()); // Get the current value of the current property we're bound to | |
$(element).toggle(value); // jQuery will hide/show the element depending on whether "value" or true or false | |
}, | |
update: function(element, valueAccessor, allBindingsAccessor) { | |
// Leave as before | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment