vdom-virtualize
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -0,0 +0,0 @@ !function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.vdomVirtualize=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ |
30
index.js
@@ -40,4 +40,3 @@ /*! | ||
domNode.innerHTML = html; // browser parses HTML into DOM tree | ||
domNode = domNode.children[0] || domNode; // select first node in tree | ||
return createVNode(domNode, key); | ||
return createVNode(domNode.firstChild, key); | ||
}; | ||
@@ -70,4 +69,2 @@ | ||
if(el[propName] instanceof Element) return | ||
// Special case: style | ||
@@ -82,5 +79,13 @@ // .style is a DOMStyleDeclaration, thus we need to iterate over all | ||
, styleProp | ||
for(var i=0; i<el.style.length; i++) { | ||
styleProp = el.style[i] | ||
css[styleProp] = el.style.getPropertyValue(styleProp) // XXX: add support for "!important" via getPropertyPriority()! | ||
if (el.style.length) { | ||
for(var i=0; i<el.style.length; i++) { | ||
styleProp = el.style[i] | ||
css[styleProp] = el.style.getPropertyValue(styleProp) // XXX: add support for "!important" via getPropertyPriority()! | ||
} | ||
} else { // IE8 | ||
for (var styleProp in el.style) { | ||
if (el.style[styleProp]) { | ||
css[styleProp] = el.style[styleProp]; | ||
} | ||
} | ||
} | ||
@@ -92,2 +97,9 @@ | ||
// https://msdn.microsoft.com/en-us/library/cc848861%28v=vs.85%29.aspx | ||
// The img element does not support the HREF content attribute. | ||
// In addition, the href property is read-only for the img Document Object Model (DOM) object | ||
if (el.tagName.toLowerCase() === 'img' && propName === 'href') { | ||
return; | ||
} | ||
// Special case: dataset | ||
@@ -133,2 +145,4 @@ // we can iterate over .dataset with a simple for..in loop. | ||
if('object' === typeof el[propName]) return | ||
// default: just copy the property | ||
@@ -166,3 +180,3 @@ obj[propName] = el[propName] | ||
,"data" | ||
,"dataset" | ||
//,"dataset" removed since attributes handles data-attributes | ||
,"defer" | ||
@@ -169,0 +183,0 @@ ,"dir" |
{ | ||
"name": "vdom-virtualize", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Virtulize any DOM node and turn it into a virtual-dom node.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
19093
612