knockout-toggle-click
v1.0.0
Published
Knockout JS toggle binding handler for click events
Downloads
3
Readme
knockout-toggle-click
Knockout JS toggle binding handler for click events
By v-braun - www.dev-things.net.
Example
var bindingRoot = document.getElementById('root');
var vm = {
showDetails: ko.observable(false)
};
ko.applyBindings(vm, bindingRoot);
<div id="root" class="panel panel-primary">
<div data-bind="toggleClick: showDetails" class="panel-heading">
<h3 class="panel-title">click to open details ..</h3>
</div>
<div data-bind="visible: showDetails" class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
</div>
Have a look at the Test directory.
Installation
NPM
npm install knockout-toggle-click --save
Bower
bower install knockout-toggle-click --save
Known Issues
If you discover any bugs, feel free to create an issue on GitHub fork and send me a pull request.
Authors
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
See LICENSE.