Comparing version 0.7.5 to 0.7.6
{ | ||
"name": "bamjs", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Backbone with modifications. Adds heirarchy to Views, turns Views into Finite State Machines, adds a mixin for decorating methods and adds utility functions to Models and Collections.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
15
view.js
@@ -82,6 +82,9 @@ // Generated by CoffeeScript 1.6.3 | ||
View.prototype.ensureClass = function(el, className) { | ||
var existing, wanted, _ref; | ||
var existing, wanted, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; | ||
if (className == null) { | ||
className = this.className; | ||
} | ||
if (el.jQuery) { | ||
return el.addClass(className); | ||
} | ||
if (!className) { | ||
@@ -91,4 +94,10 @@ return; | ||
wanted = (_ref = className != null ? className.split(/\s+/) : void 0) != null ? _ref : []; | ||
existing = el.className.split(/\s+/); | ||
return el.className = _.uniq(existing.concat(wanted)).join(' '); | ||
switch (typeof el.className) { | ||
case 'string': | ||
existing = (_ref1 = (_ref2 = el.className) != null ? _ref2.split(/\s+/) : void 0) != null ? _ref1 : []; | ||
return el.className = _.uniq(existing.concat(wanted)).join(' '); | ||
case 'object': | ||
existing = (_ref3 = (_ref4 = el.className) != null ? (_ref5 = _ref4.baseVal) != null ? _ref5.split(/\s+/) : void 0 : void 0) != null ? _ref3 : []; | ||
return (_ref6 = el.className) != null ? _ref6.baseVal = _.uniq(existing.concat(wanted)).join(' ') : void 0; | ||
} | ||
}; | ||
@@ -95,0 +104,0 @@ |
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
26272
669