Skip to content

Commit

Permalink
Fix indentation, use jQuery.each instead of map
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenj committed Dec 12, 2016
1 parent a954df4 commit ef143e8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/featherlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,31 @@
'sandbox', 'src', 'srcdoc', 'width'],
attrs = {};

whiteList.map(function(item) {
$.each(whiteList, function(index, item) {
var attrValue = parseAttrs(obj, 'iframe')[item];

if (attrValue) {
attrs[item] = attrValue;
return attrs[item];
}
}
});

return attrs;
}
};

function parseAttrs(obj, prefix) {
var attrs = {},
regex = new RegExp('^' + prefix + '([A-Z])(.*)');
for (var key in obj) {
var match = key.match(regex);
if (match) {
var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase();
attrs[dasherized] = obj[key];
function parseAttrs(obj, prefix) {
var attrs = {},
regex = new RegExp('^' + prefix + '([A-Z])(.*)');
for (var key in obj) {
var match = key.match(regex);
if (match) {
var dasherized = (match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase();
attrs[dasherized] = obj[key];
}
}
return attrs;
}
return attrs;
}

/* document wide key handler */
var eventMap = { keyup: 'onKeyUp', resize: 'onResize' };
Expand Down

0 comments on commit ef143e8

Please sign in to comment.