mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
fixed my empty frag logic, changed liveui tests back to original
This commit is contained in:
committed by
Geoff Schmidt
parent
c2c903f3ef
commit
2116a9c239
@@ -173,7 +173,7 @@ _.extend(Meteor, (function() {
|
||||
leadingWhitespaceKilled: (testDiv.firstChild.nodeType !== 3),
|
||||
|
||||
// IE may insert an empty tbody tag in a table.
|
||||
tbodyInserted: testDiv.getElementsByTagName("tbody").length > 0,
|
||||
tbodyInsertion: testDiv.getElementsByTagName("tbody").length > 0,
|
||||
|
||||
// IE loses some tags in some environments (requiring extra wrapper).
|
||||
tagsLost: testDiv.getElementsByTagName("link").length == 0
|
||||
@@ -216,7 +216,9 @@ _.extend(Meteor, (function() {
|
||||
var doc = document; // node factory
|
||||
var frag = doc.createDocumentFragment();
|
||||
|
||||
if (! rhtml.test(html)) {
|
||||
if (! html.length) {
|
||||
// empty, do nothing
|
||||
} else if (! rhtml.test(html)) {
|
||||
// Just text.
|
||||
frag.appendChild(doc.createTextNode(html));
|
||||
} else {
|
||||
@@ -237,7 +239,7 @@ _.extend(Meteor, (function() {
|
||||
container = container.lastChild;
|
||||
}
|
||||
|
||||
if (quirks.tbodyInserted && ! rtbody.test(html)) {
|
||||
if (quirks.tbodyInsertion && ! rtbody.test(html)) {
|
||||
// Any tbody we find was created by the browser.
|
||||
var tbodies = container.getElementsByTagName("tbody");
|
||||
_.each(tbodies, function(n) {
|
||||
|
||||
@@ -864,7 +864,7 @@ test("renderList - #each", function () {
|
||||
onscreen.appendChild(Template.test_renderList_each());
|
||||
document.body.appendChild(onscreen);
|
||||
|
||||
assert_frag("~Before0~Middle~Else~After~", onscreen);
|
||||
assert_frag("~Before0<!---->~Middle~Else~After~", onscreen);
|
||||
assert.length(_.keys(weather_listeners.here), 0);
|
||||
|
||||
c.insert({x: 2, name: "A"});
|
||||
@@ -889,7 +889,7 @@ test("renderList - #each", function () {
|
||||
assert.length(_.keys(weather_listeners.here), 1);
|
||||
|
||||
c.update({}, {$set: {x: 5}});
|
||||
assert_frag("~Before0~Middle~Else~After~", onscreen);
|
||||
assert_frag("~Before0<!---->Middle~Else~After~", onscreen);
|
||||
assert.length(_.keys(weather_listeners.here), 1);
|
||||
Meteor.flush();
|
||||
assert.length(_.keys(weather_listeners.here), 0);
|
||||
|
||||
Reference in New Issue
Block a user