This file contains hidden or 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
var Example = Example || {}; | |
Example = (function() { | |
var component = function() { | |
ko.components.register('test',{ | |
viewModel: function(params) { | |
var self = this; | |
self.init = function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { | |
setTimeout(function() { |
This file contains hidden or 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
var app; | |
app = app || (function () { | |
var process = $('<div class="modal modal-static fade" id="processing-modal" role="dialog" aria-hidden="true" data-keyboard="false" data-backdrop="static" style="overflow: hidden;"><div class="modal-dialog" style="width: 180px;"><div class="modal-content"><div class="modal-body"><div class="text-center"><i class="fa fa-spinner fa-spin" style="font-size: 64px;"></i><h4>Processing...</h4></div></div></div></div></div>'); | |
return { | |
showProcess: function () { | |
process.modal('show'); | |
}, | |
hideProcess: function () { | |
process.modal('hide'); | |
} |
This file contains hidden or 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.select2 = { | |
init: function (element, valueAccessor, allBindingsAccessor) { | |
var obj = valueAccessor(), | |
allBindings = allBindingsAccessor(), | |
lookupKey = allBindings.lookupKey; | |
var select2 = $(element).select2(obj); | |
// Bind events | |
if ("on" in obj) { | |
for (var event in obj.on) { |