From 03733380f5b2181b803b8dfffa2341fffa6b38c5 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Mon, 22 Aug 2016 11:04:29 -0400 Subject: [PATCH] fix(panel): Element reference error All references to `panelContainer` and `panelEl` have been verified as public, and the methods that contained the offending references have been corrected. Fixes #9374 Ping @ErinCoughlan --- src/components/panel/panel.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/panel/panel.js b/src/components/panel/panel.js index a744e91e94..1627405b7b 100644 --- a/src/components/panel/panel.js +++ b/src/components/panel/panel.js @@ -1105,14 +1105,14 @@ MdPanelRef.prototype.addClass = function(newClass, toElement) { 'To achieve the same results, use the panelContainer or panelEl ' + 'JQLite elements that are referenced in MdPanelRef.'); - if (!this._panelContainer) { + if (!this.panelContainer) { throw new Error('Panel does not exist yet. Call open() or attach().'); } - if (!toElement && !this._panelContainer.hasClass(newClass)) { - this._panelContainer.addClass(newClass); - } else if (toElement && !this._panelEl.hasClass(newClass)) { - this._panelEl.addClass(newClass); + if (!toElement && !this.panelContainer.hasClass(newClass)) { + this.panelContainer.addClass(newClass); + } else if (toElement && !this.panelEl.hasClass(newClass)) { + this.panelEl.addClass(newClass); } }; @@ -1135,14 +1135,14 @@ MdPanelRef.prototype.removeClass = function(oldClass, fromElement) { 'To achieve the same results, use the panelContainer or panelEl ' + 'JQLite elements that are referenced in MdPanelRef.'); - if (!this._panelContainer) { + if (!this.panelContainer) { throw new Error('Panel does not exist yet. Call open() or attach().'); } - if (!fromElement && this._panelContainer.hasClass(oldClass)) { - this._panelContainer.removeClass(oldClass); - } else if (fromElement && this._panelEl.hasClass(oldClass)) { - this._panelEl.removeClass(oldClass); + if (!fromElement && this.panelContainer.hasClass(oldClass)) { + this.panelContainer.removeClass(oldClass); + } else if (fromElement && this.panelEl.hasClass(oldClass)) { + this.panelEl.removeClass(oldClass); } }; @@ -1165,14 +1165,14 @@ MdPanelRef.prototype.toggleClass = function(toggleClass, onElement) { 'To achieve the same results, use the panelContainer or panelEl ' + 'JQLite elements that are referenced in MdPanelRef.'); - if (!this._panelContainer) { + if (!this.panelContainer) { throw new Error('Panel does not exist yet. Call open() or attach().'); } if (!onElement) { - this._panelContainer.toggleClass(toggleClass); + this.panelContainer.toggleClass(toggleClass); } else { - this._panelEl.toggleClass(toggleClass); + this.panelEl.toggleClass(toggleClass); } };