can-stache
Advanced tools
Comparing version 5.0.0-pre.4 to 5.0.0-pre.5
@function can-stache.helpers.is {{#is(expressions)}} | ||
@parent can-stache/deprecated | ||
@deprecated {4.15.0} Use [can-stache.helpers.if] instead. | ||
@deprecated {4.15.0} Use [can-stache.helpers.eq] instead. | ||
@@ -6,0 +6,0 @@ @signature `{{#is([EXPRESSION...])}}FN{{else}}INVERSE{{/is}}` |
{ | ||
"name": "can-stache", | ||
"version": "5.0.0-pre.4", | ||
"version": "5.0.0-pre.5", | ||
"description": "Live binding handlebars templates", | ||
@@ -17,2 +17,4 @@ "homepage": "https://canjs.com/doc/can-stache.html", | ||
"scripts": { | ||
"ci": "npm run test && node test/test-saucelabs.js", | ||
"http-server": "http-server -p 3000 --silent", | ||
"preversion": "npm test", | ||
@@ -72,2 +74,3 @@ "postpublish": "git push --tags && git push", | ||
"detect-cyclic-packages": "^1.1.0", | ||
"http-server": "^0.11.0", | ||
"jshint": "^2.9.4", | ||
@@ -78,4 +81,5 @@ "steal": "^1.5.19", | ||
"steal-tools": "^1.0.1", | ||
"test-saucelabs": "^0.0.6", | ||
"testee": "^0.9.1" | ||
} | ||
} |
@@ -97,4 +97,26 @@ var stache = require("can-stache"); | ||
var clone = function(node) { | ||
var length = childNodes(node).length; | ||
var cloned = node.cloneNode(true); | ||
var clonedChildNodes = ArrayFrom(childNodes(cloned)); | ||
var clonedLength = clonedChildNodes.length; | ||
// Fix weird cloneNode bug in IE11 | ||
if(clonedLength && clonedLength > length) { | ||
var first = clonedChildNodes[0]; | ||
for(var index = 1; index < clonedLength; index++) { | ||
var clonedChildNode = clonedChildNodes[index]; | ||
if (clonedChildNode.nodeType === 3) { | ||
first.nodeValue += clonedChildNode.nodeValue; | ||
clonedChildNode.parentNode.removeChild(clonedChildNode); | ||
} | ||
} | ||
} | ||
return cloned; | ||
}; | ||
function cloneAndClean(node) { | ||
return removePlaceholderNodes( node.cloneNode(true) ); | ||
return removePlaceholderNodes( clone(node) ); | ||
} | ||
@@ -101,0 +123,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
614887
134
11807
15