Skip to content

Commit

Permalink
Use attr.name to get an attribute's name
Browse files Browse the repository at this point in the history
Zombie 5.x doesn't support attr.nodeName any more. So we will use whichever we get. Fixes #1177
  • Loading branch information
matthewp committed Apr 25, 2017
1 parent 0988858 commit c6233bc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,11 +1404,12 @@ addStealExtension(function (loader) {
scriptOptions.stealURL = script.src;

each(script.attributes, function(attr){
var nodeName = attr.nodeName || attr.name;
// get option, remove "data" and camelize
var optionName =
camelize( attr.nodeName.indexOf("data-") === 0 ?
attr.nodeName.replace("data-","") :
attr.nodeName );
camelize( nodeName.indexOf("data-") === 0 ?
nodeName.replace("data-","") :
nodeName );
// make options uniform e.g. baseUrl => baseURL
optionName = optionName.replace(urlRegEx, "URL")
scriptOptions[optionName] = (attr.value === "") ? true : attr.value;
Expand Down
7 changes: 4 additions & 3 deletions src/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
scriptOptions.stealURL = script.src;

each(script.attributes, function(attr){
var nodeName = attr.nodeName || attr.name;
// get option, remove "data" and camelize
var optionName =
camelize( attr.nodeName.indexOf("data-") === 0 ?
attr.nodeName.replace("data-","") :
attr.nodeName );
camelize( nodeName.indexOf("data-") === 0 ?
nodeName.replace("data-","") :
nodeName );
// make options uniform e.g. baseUrl => baseURL
optionName = optionName.replace(urlRegEx, "URL")
scriptOptions[optionName] = (attr.value === "") ? true : attr.value;
Expand Down
7 changes: 4 additions & 3 deletions steal-sans-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -5705,11 +5705,12 @@ addStealExtension(function (loader) {
scriptOptions.stealURL = script.src;

each(script.attributes, function(attr){
var nodeName = attr.nodeName || attr.name;
// get option, remove "data" and camelize
var optionName =
camelize( attr.nodeName.indexOf("data-") === 0 ?
attr.nodeName.replace("data-","") :
attr.nodeName );
camelize( nodeName.indexOf("data-") === 0 ?
nodeName.replace("data-","") :
nodeName );
// make options uniform e.g. baseUrl => baseURL
optionName = optionName.replace(urlRegEx, "URL")
scriptOptions[optionName] = (attr.value === "") ? true : attr.value;
Expand Down
2 changes: 1 addition & 1 deletion steal-sans-promises.production.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions steal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6975,11 +6975,12 @@ addStealExtension(function (loader) {
scriptOptions.stealURL = script.src;

each(script.attributes, function(attr){
var nodeName = attr.nodeName || attr.name;
// get option, remove "data" and camelize
var optionName =
camelize( attr.nodeName.indexOf("data-") === 0 ?
attr.nodeName.replace("data-","") :
attr.nodeName );
camelize( nodeName.indexOf("data-") === 0 ?
nodeName.replace("data-","") :
nodeName );
// make options uniform e.g. baseUrl => baseURL
optionName = optionName.replace(urlRegEx, "URL")
scriptOptions[optionName] = (attr.value === "") ? true : attr.value;
Expand Down
2 changes: 1 addition & 1 deletion steal.production.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/npm/bower/node_modules/steal/steal.production.js

Large diffs are not rendered by default.

0 comments on commit c6233bc

Please sign in to comment.