Skip to content

Commit

Permalink
update after review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioCrisostomo committed Jul 3, 2014
1 parent 866d914 commit dbabf06
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Source/Element/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Document.implement({
if (!canChangeStyleHTML && tag == 'style'){
var styleElement = document.createElement('style');
styleElement.setAttribute('type', 'text/css');
props.type && delete props.type;
if (props.type) delete props.type;
return this.id(styleElement).set(props);
}
/*</ltIE9>*/
Expand Down Expand Up @@ -552,16 +552,28 @@ properties.text = (document.createElement('div').textContent == null) ? 'innerTe

Object.forEach(properties, function(real, key){
propertySetters[key] = function(node, value){
/*<ltIE9>*/
if (node.get('tag') == 'style' && node.styleSheet) node.set('html', value);
else /*</ltIE9>*/node[real] = value;
node[real] = value;
};
propertyGetters[key] = function(node){
if (node.get('tag') == 'style' && node.styleSheet) return node.innerHTML;
return node[real];
};
});

/*<ltIE9>*/
propertySetters.text = (function(setter){
return function(node, value){
if (node.get('tag') == 'style') node.set('html', value);
else node[properties.text] = value;
};
})(propertySetters.text);

propertyGetters.text = (function(getter){
return function(node){
return (node.get('tag') == 'style') ? node.innerHTML : getter(node);
};
})(propertyGetters.text);
/*</ltIE9>*/

// Booleans

var bools = [
Expand Down

0 comments on commit dbabf06

Please sign in to comment.