diff --git a/packages/blaze/view.js b/packages/blaze/view.js index 041be57122..92552d009b 100644 --- a/packages/blaze/view.js +++ b/packages/blaze/view.js @@ -57,7 +57,7 @@ Blaze.View = function (name, render) { this.isCreated = false; this._isCreatedForExpansion = false; this.isRendered = false; - this.isAttached = false; + this._isAttached = false; this.isDestroyed = false; this._isInRender = false; this.parentView = null; @@ -168,14 +168,14 @@ Blaze.View.prototype.autorun = function (f, _inViewScope) { }; Blaze.View.prototype.firstNode = function () { - if (! this.isAttached) + if (! this._isAttached) throw new Error("View must be attached before accessing its DOM"); return this._domrange.firstNode(); }; Blaze.View.prototype.lastNode = function () { - if (! this.isAttached) + if (! this._isAttached) throw new Error("View must be attached before accessing its DOM"); return this._domrange.lastNode(); @@ -249,7 +249,7 @@ Blaze._materializeView = function (view, parentView) { var teardownHook = null; domrange.onAttached(function attached(range, element) { - view.isAttached = true; + view._isAttached = true; teardownHook = Blaze._DOMBackend.Teardown.onElementTeardown( element, function teardown() { diff --git a/packages/blaze/view_tests.js b/packages/blaze/view_tests.js index 58a361a80f..d80bd9cd9d 100644 --- a/packages/blaze/view_tests.js +++ b/packages/blaze/view_tests.js @@ -26,7 +26,7 @@ if (Meteor.isClient) { var div = document.createElement("DIV"); test.isFalse(v.isRendered); - test.isFalse(v.isAttached); + test.isFalse(v._isAttached); test.equal(canonicalizeHtml(div.innerHTML), ""); test.throws(function () { v.firstNode(); }, /View must be attached/); test.throws(function () { v.lastNode(); }, /View must be attached/); @@ -35,7 +35,7 @@ if (Meteor.isClient) { test.equal(typeof (v.firstNode().nodeType), "number"); test.equal(typeof (v.lastNode().nodeType), "number"); test.isTrue(v.isRendered); - test.isTrue(v.isAttached); + test.isTrue(v._isAttached); test.equal(buf, 'c0r1'); test.equal(canonicalizeHtml(div.innerHTML), "foo"); Deps.flush();