Closed PhonicUK closed 1 year ago
I only implemented deepStartPress but here is a nice way to use it with KO bindings:
ko.bindingHandlers.forcePush = {
init: function (element, valueAccessor, _allBindings, viewModel) {
var callback = valueAccessor();
Pressure.set(element, {
startDeepPress: function (event) {
callback.call(viewModel, element, event);
},
});
},
};
Then you can do
<div data-bind="forcePush: menu">
How can I integrate this with KnockoutJS so that newly created elements via a template get registered and so I can use the force-push event in Knockout binding?