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
define([ | |
'ko', | |
'jquery' | |
], function (ko, $) { | |
ko.bindingHandlers.notification = { | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel) { | |
var rawValue = valueAccessor(), | |
//notification can be passed an object with properties 'message', 'duration', 'fadeoutDuration', 'hide', 'fade', and 'callback', or it can be given just a string | |
options = typeof rawValue == 'object' ? rawValue : { message: rawValue }, | |
message = ko.utils.unwrapObservable(options.message), |
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
/* ============================================ | |
* bootstrap-infiniteScroll.js | |
* ============================================ */ | |
!function ($) { | |
'use strict'; | |
var InfiniteScroll = function (el, options) { | |
this.$element = $(el); | |
this.$data = $(el).data(); | |
this.$options = options; |
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
(function ($) { | |
"use strict"; | |
var hasTouch = 'ontouchstart' in window; | |
//CONSTANTS | |
var MOVE_EVENT = hasTouch ? 'touchmove' : 'mousemove', | |
START_EVENT = hasTouch ? 'touchstart' : 'mousedown', | |
STOP_EVENT = hasTouch ? 'touchend' : 'mouseup'; | |
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.executeOnEnter = { | |
init: function (element, valueAccessor, allBindingsAccessor, viewModel) { | |
var allBindings = allBindingsAccessor(); | |
$(element).keypress(function (event) { | |
var keyCode = (event.which ? event.which : event.keyCode); | |
if (keyCode === 13) { | |
ko.utils.triggerEvent(element, 'change'); | |
allBindings.executeOnEnter.call(viewModel, viewModel, event); | |
return false; |
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.templateWithClear = { | |
init: function (element, valueAccessor) { | |
element.innerHTML = ''; | |
return ko.bindingHandlers.template.init(element, valueAccessor); | |
}, | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { | |
return ko.bindingHandlers.template.update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext); | |
} | |
} |
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.modal = { | |
init: function (element, valueAccessor, bindingsAccessor, viewModel, bindingContext) { | |
var $element = $(element); | |
$element.addClass('hide modal'); | |
$element.modal({ | |
show: false | |
}); | |
var bindings = bindingsAccessor(); | |
if (bindings.modalOptions) { |