Software: Apache/2.2.22 (Debian). PHP/5.6.36 uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) Safe-mode: OFF (not secure) /home/h33678/data/www/it-man.ztu.edu.ua/bower_components/knockout/src/binding/defaultBindings/ drwxr-xr-x |
Viewing file: Select action/file-type: // For certain common events (currently just 'click'), allow a simplified data-binding syntax // e.g. click:handler instead of the usual full-length event:{click:handler} function makeEventHandlerShortcut(eventName) { ko.bindingHandlers[eventName] = { 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) { var newValueAccessor = function () { var result = {}; result[eventName] = valueAccessor(); return result; }; return ko.bindingHandlers['event']['init'].call(this, element, newValueAccessor, allBindings, viewModel, bindingContext); } } } ko.bindingHandlers['event'] = { 'init' : function (element, valueAccessor, allBindings, viewModel, bindingContext) { var eventsToHandle = valueAccessor() || {}; ko.utils.objectForEach(eventsToHandle, function(eventName) { if (typeof eventName == "string") { ko.utils.registerEventHandler(element, eventName, function (event) { var handlerReturnValue; var handlerFunction = valueAccessor()[eventName]; if (!handlerFunction) return; try { // Take all the event args, and prefix with the viewmodel var argsForHandler = ko.utils.makeArray(arguments); viewModel = bindingContext['$data']; argsForHandler.unshift(viewModel); handlerReturnValue = handlerFunction.apply(viewModel, argsForHandler); } finally { if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true. if (event.preventDefault) event.preventDefault(); else event.returnValue = false; } } var bubble = allBindings.get(eventName + 'Bubble') !== false; if (!bubble) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); } }); } }); } }; |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0112 ]-- |