@olton/query
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -211,3 +211,3 @@ "use strict"; | ||
if (!events[index]) { | ||
if ((0, _jsUtils.undef)(events[index])) { | ||
return undefined; | ||
@@ -252,3 +252,3 @@ } | ||
if (!event) { | ||
if ((0, _jsUtils.undef)(event)) { | ||
this.eventHooks = {}; | ||
@@ -282,3 +282,3 @@ } else { | ||
dataSet: function dataSet(ns) { | ||
if (!ns) return $.dataset; | ||
if ((0, _jsUtils.undef)(ns)) return $.dataset; | ||
@@ -285,0 +285,0 @@ if (['INTERNAL', 'QUERY'].includes(ns.toUpperCase())) { |
@@ -44,3 +44,3 @@ "use strict"; | ||
if (!name) { | ||
if ((0, _jsUtils.undef)(name)) { | ||
return this.each(function () { | ||
@@ -66,3 +66,3 @@ var el = this; | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
el.removeAttribute(name); | ||
@@ -69,0 +69,0 @@ } else { |
@@ -16,10 +16,11 @@ "use strict"; | ||
var result = false; | ||
var classes = cls.split(" ").filter(function (v) { | ||
return ("" + v).trim() !== ""; | ||
}); | ||
var classes; | ||
if (!cls) { | ||
if (!cls || typeof cls !== "string") { | ||
return false; | ||
} | ||
classes = cls.split(" ").filter(function (v) { | ||
return ("" + v).trim() !== ""; | ||
}); | ||
this.each(function () { | ||
@@ -26,0 +27,0 @@ var el = this; |
@@ -32,3 +32,3 @@ "use strict"; | ||
if (!sel) { | ||
if ((0, _jsUtils.undef)(sel)) { | ||
el = this[0]; | ||
@@ -43,3 +43,3 @@ } else if ((0, _jsUtils.isArrayLike)(sel)) { | ||
if (!el) { | ||
if ((0, _jsUtils.undef)(el)) { | ||
return _index; | ||
@@ -46,0 +46,0 @@ } |
@@ -78,7 +78,7 @@ "use strict"; | ||
if (!name && !value) { | ||
if ((0, _jsUtils.undef)(name) && (0, _jsUtils.undef)(value)) { | ||
return _index["default"].data(this[0]); | ||
} | ||
if (!value) { | ||
if ((0, _jsUtils.undef)(value)) { | ||
var res = _index["default"].data(this[0], "origin-" + name); | ||
@@ -85,0 +85,0 @@ |
@@ -8,2 +8,4 @@ "use strict"; | ||
var _jsUtils = require("@olton/js-utils"); | ||
var _dollar = _interopRequireDefault(require("../dollar")); | ||
@@ -17,3 +19,3 @@ | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
if (this.length === 0) return undefined; | ||
@@ -77,3 +79,3 @@ rect = this.rect(); | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
return this.position(margin).left; | ||
@@ -97,3 +99,3 @@ } | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
return this.position(margin).top; | ||
@@ -100,0 +102,0 @@ } |
@@ -8,2 +8,4 @@ "use strict"; | ||
var _jsUtils = require("@olton/js-utils"); | ||
var _dollar = _interopRequireDefault(require("../dollar")); | ||
@@ -17,3 +19,3 @@ | ||
if (val !== undefined || val !== null) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
var el = this[0]; | ||
@@ -20,0 +22,0 @@ |
@@ -43,3 +43,3 @@ "use strict"; | ||
if (!name || name === "all") { | ||
if ((0, _jsUtils.undef)(name) || name === "all") { | ||
return getComputedStyle(el, pseudo); | ||
@@ -65,3 +65,3 @@ } else { | ||
removeStyle: function removeStyle(name) { | ||
if (!name || this.length === 0) return this; | ||
if ((0, _jsUtils.undef)(name) || this.length === 0) return this; | ||
var names = name.split(",").map(function (el) { | ||
@@ -99,3 +99,3 @@ return ("" + el).trim(); | ||
scrollTop: function scrollTop(val) { | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
return this.length === 0 ? undefined : this[0] === window ? pageYOffset : this[0].scrollTop; | ||
@@ -109,3 +109,3 @@ } | ||
scrollLeft: function scrollLeft(val) { | ||
if (!val) { | ||
if ((0, _jsUtils.undef)(val)) { | ||
return this.length === 0 ? undefined : this[0] === window ? pageXOffset : this[0].scrollLeft; | ||
@@ -112,0 +112,0 @@ } |
{ | ||
"name": "@olton/query", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Javascript class for DOM manipulation and querying", | ||
@@ -43,3 +43,3 @@ "main": "index.js", | ||
"url-loader": "^3.0.0", | ||
"webpack": "^4.41.6", | ||
"webpack": "^4.42.0", | ||
"webpack-cli": "^3.3.11", | ||
@@ -50,4 +50,4 @@ "webpack-dashboard": "^3.2.0", | ||
"dependencies": { | ||
"@olton/js-utils": "^0.11.5" | ||
"@olton/js-utils": "^0.11.6" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67153
1886
Updated@olton/js-utils@^0.11.6