X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/3892eb4ed993ba60f53f3daa35110ed1c99f8fe1..9559f99e87eaa89fec3095451a6ad60f5ead13e2:/views/tabs/tabs.js?ds=sidebyside diff --git a/views/tabs/tabs.js b/views/tabs/tabs.js index 7298d4e..bc14083 100644 --- a/views/tabs/tabs.js +++ b/views/tabs/tabs.js @@ -57,8 +57,12 @@ define([ if(slug !== this.selectedTab && this.contents[slug]) { this.trigger('leaving', this.selectedTab); - if(this.selectedTab) - this.contents[this.selectedTab].detach(); + if(this.selectedTab) { + var toDetach = this.contents[this.selectedTab]; + if(toDetach.onHide) + toDetach.onHide(); + toDetach.detach(); + } this.nodes.content.append(this.contents[slug]); if(this.contents[slug].onShow) { this.contents[slug].onShow();