Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "corridor", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "JSON/HTML data corridor for data-binding", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -336,3 +336,3 @@ /** | ||
if (field || elem.hasAttribute('data-opts')) { | ||
if (field || hasOpts(elem)) { | ||
opts = options(elem, defaults); | ||
@@ -354,2 +354,19 @@ res = callback(elem, field, opts); | ||
/** | ||
* Check whether a given element has any options directly specified. | ||
* @param {HTMLElement} elem The element to inspect. | ||
* @return {boolean} True if this element has any options specified. | ||
*/ | ||
hasOpts = corridor.hasOpts = function(elem) { | ||
if (elem.hasAttribute('data-opts')) { | ||
return true; | ||
} | ||
for (var k in defaults) { | ||
if (elem.hasAttribute('data-' + k)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}, | ||
/** | ||
* Convert a simple name attribute string into a full field string if it isn't already. | ||
@@ -356,0 +373,0 @@ * The simple name format is a hybrid of Apple's Key-Value Coding and PHP's array-based form variables. |
Sorry, the diff of this file is not supported yet
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
91102
1367