X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0ca7242564aa1a2bdc1ab6891d46cae7d44dd889..b20691e774cac0cbf2ee174472a1b1dbc94fa61b:/views/tabs/tabs.js?ds=sidebyside diff --git a/views/tabs/tabs.js b/views/tabs/tabs.js index 7c94938..bc14083 100644 --- a/views/tabs/tabs.js +++ b/views/tabs/tabs.js @@ -57,9 +57,16 @@ 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(); + } this.nodes.tabBar.find('.active').removeClass('active'); this.nodes.tabBar.find('a[href="#'+slug+'"]').parent().addClass('active');