Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/components/panel/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

Expand All @@ -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);
}
};

Expand All @@ -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);
}
};

Expand Down