Comparing version 0.4.11 to 0.4.12
@@ -1,9 +0,9 @@ | ||
var attr = 'disabled'; | ||
var className = 'disabled'; | ||
/** | ||
* Toggles the diabled attribute on an element. | ||
* Toggles the disabled class on an element. | ||
* | ||
* A typical css rule might be: | ||
* | ||
* [disabled]{pointer-events: none; opacity: 0.8;} | ||
* .disabled{pointer-events: none; opacity: 0.8;} | ||
*/ | ||
@@ -14,9 +14,9 @@ function disabled(val) { | ||
if(val === undefined) { | ||
return this.attr(attr); | ||
return this.hasClass(className); | ||
// hide on truthy | ||
}else if(val) { | ||
this.attr(attr, '1'); | ||
this.addClass(className); | ||
// show on falsey | ||
}else{ | ||
this.attr(attr, null); | ||
this.removeClass(className); | ||
} | ||
@@ -23,0 +23,0 @@ return this; |
@@ -78,2 +78,8 @@ /** | ||
// sadly IE10/11 does not support `json` response type | ||
// see: http://caniuse.com/#feat=xhr2 | ||
if(opts.responseType) { | ||
req.responseType = opts.responseType; | ||
} | ||
// apply custom request headers | ||
@@ -90,9 +96,13 @@ for(z in opts.headers) { | ||
if(this.readyState === 4) { | ||
var res = this.responseText | ||
var res = opts.responseType ? this.response : this.responseText | ||
, info = { | ||
headers: parse(this.getAllResponseHeaders()), status: this.status}; | ||
headers: parse(this.getAllResponseHeaders()), | ||
status: this.status | ||
}; | ||
info.body = res; | ||
if(res && opts.json && (this.status === 200 || this.status === 201)) { | ||
try { | ||
info.body = JSON.parse(res); | ||
info.body = JSON.parse(this.responseText); | ||
}catch(e) { | ||
@@ -99,0 +109,0 @@ return done( |
{ | ||
"name": "air", | ||
"description": "Lightweight, modular DOM library", | ||
"version": "0.4.11", | ||
"version": "0.4.12", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
49018
1321