Skip to content

Commit ade3fa0

Browse files
committed
-Fixed bug with closing a panel losing it's parent before the close event.
1 parent ef75edc commit ade3fa0

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Build/wcDocker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ wcDocker.prototype = {
145145

146146
var parentFrame = panel._parent;
147147
if (parentFrame instanceof wcFrame) {
148+
panel.__trigger(wcDocker.EVENT_CLOSED);
149+
148150
// If no more panels remain in this frame, remove the frame.
149151
if (!parentFrame.removePanel(panel)) {
150152
var index = this._floatingList.indexOf(parentFrame);
@@ -2165,7 +2167,6 @@ wcPanel.prototype = {
21652167
// Destroys this panel.
21662168
__destroy: function() {
21672169
this._panelObject = null;
2168-
this.__trigger(wcDocker.EVENT_CLOSED);
21692170
this.off();
21702171

21712172
this.__container(null);

Build/wcDocker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Code/docker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ wcDocker.prototype = {
145145

146146
var parentFrame = panel._parent;
147147
if (parentFrame instanceof wcFrame) {
148+
panel.__trigger(wcDocker.EVENT_CLOSED);
149+
148150
// If no more panels remain in this frame, remove the frame.
149151
if (!parentFrame.removePanel(panel)) {
150152
var index = this._floatingList.indexOf(parentFrame);

Code/panel.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ wcPanel.prototype = {
411411
// Destroys this panel.
412412
__destroy: function() {
413413
this._panelObject = null;
414-
this.__trigger(wcDocker.EVENT_CLOSED);
415414
this.off();
416415

417416
this.__container(null);

0 commit comments

Comments
 (0)