Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knockout.spin

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knockout.spin - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

34

knockout.spin.js
var ko = require("knockout");
var $ = require("jquery");
var objectAssign = require("object-assign");
var Promise = require("pinkie-promise");
var Spinner = require("spin.js");

@@ -8,16 +9,15 @@

// initialize the object which will return the eventual spinner
var deferred = $.Deferred();
element.spinner = deferred.promise();
element.spinner = new Promise(function (resolve) {
// force this to the bottom of the event queue in the rendering thread,
// so we can get the computed color of the containing element after other bindings
// (e.g. class, style) have evalutated.
// HACK: add some more delay as the class bindings of the parent fire asynchronously.
setTimeout(function () {
var options = {};
options.color = element.ownerDocument.defaultView.getComputedStyle(element, null).color;
objectAssign(options, ko.bindingHandlers.spinner.defaultOptions, ko.unwrap(allBindings.get("spinnerOptions")));
// force this to the bottom of the event queue in the rendering thread,
// so we can get the computed color of the containing element after other bindings
// (e.g. class, style) have evalutated.
// HACK: add some more delay as the class bindings of the parent fire asynchronously.
setTimeout(function () {
var options = {};
options.color = $(element).css("color");
$.extend(options, ko.bindingHandlers.spinner.defaultOptions, ko.unwrap(allBindings.get("spinnerOptions")));
deferred.resolve(new Spinner(options));
}, 30);
resolve(new Spinner(options));
}, 30);
});
},

@@ -29,6 +29,6 @@ update: function (element, valueAccessor) {

element.spinner.done(function (spinner) {
element.spinner.then(function (spinner) {
var isSpinning = result;
if (isSpinning) {
$(element).show();
element.style.display = "";
spinner.spin(element);

@@ -40,3 +40,3 @@ } else {

$(element).hide();
element.style.display = "none";
}

@@ -43,0 +43,0 @@ });

{
"name": "knockout.spin",
"version": "2.0.3",
"version": "2.1.0",
"description": "> Simple knockout binding that wraps [spin.js](http://fgnass.github.io/spin.js/).",

@@ -23,5 +23,6 @@ "main": "knockout.spin.js",

"dependencies": {
"jquery": ">=1.10",
"object-assign": "^4.1.1",
"pinkie-promise": "^2.0.1",
"spin.js": ">=1 < 3"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc