diff --git a/ko-cart/index.html b/ko-cart/index.html index 3474230..a98d712 100644 --- a/ko-cart/index.html +++ b/ko-cart/index.html @@ -27,6 +27,7 @@ + diff --git a/ko-cart/js/custom/koBindings.js b/ko-cart/js/custom/koBindings.js new file mode 100644 index 0000000..4539768 --- /dev/null +++ b/ko-cart/js/custom/koBindings.js @@ -0,0 +1,10 @@ +ko.bindingHandlers.toggle = { + init: function (element, valueAccessor) { + var value = valueAccessor(); + ko.applyBindingsToNode(element, { + click: function() { + value(!value()); + } + }); + } +}; \ No newline at end of file diff --git a/ko-cart/views/header.html b/ko-cart/views/header.html index cab4da7..b0c1556 100644 --- a/ko-cart/views/header.html +++ b/ko-cart/views/header.html @@ -9,7 +9,7 @@