Fix Bug 43520, Bug 46178

This commit is contained in:
Julia Radzhabova 2020-08-19 17:06:45 +03:00
parent d5e0c18629
commit 6ffa2f6da5

View file

@ -62,8 +62,10 @@ define([
function onTabDblclick(e) { function onTabDblclick(e) {
var tab = $(e.currentTarget).find('> a[data-tab]').data('tab'); var tab = $(e.currentTarget).find('> a[data-tab]').data('tab');
if ( this.dblclick_el == tab ) if ( this.dblclick_el == tab ) {
this.fireEvent('change:compact', [tab]); this.fireEvent('change:compact', [tab]);
this.dblclick_el = undefined;
}
} }
function onShowFullviewPanel(state) { function onShowFullviewPanel(state) {
@ -237,14 +239,19 @@ define([
var me = this; var me = this;
var $target = $(e.currentTarget); var $target = $(e.currentTarget);
var tab = $target.find('> a[data-tab]').data('tab'); var tab = $target.find('> a[data-tab]').data('tab');
var islone = $target.hasClass('x-lone'); if ($target.hasClass('x-lone')) {
if ( me.isFolded ) { me.isFolded && me.collapse();
if ( $target.hasClass('x-lone') ) { } else {
me.collapse();
// me.fireEvent('')
} else
if ( $target.hasClass('active') ) { if ( $target.hasClass('active') ) {
!me._timerSetTab && me.collapse(); if (!me._timerSetTab) {
me.dblclick_el = tab;
if ( me.isFolded ) {
me.collapse();
setTimeout(function(){
me.dblclick_el = undefined;
}, 500);
}
}
} else { } else {
me._timerSetTab = true; me._timerSetTab = true;
setTimeout(function(){ setTimeout(function(){
@ -252,11 +259,13 @@ define([
}, 500); }, 500);
me.setTab(tab); me.setTab(tab);
me.processPanelVisible(null, true); me.processPanelVisible(null, true);
} if ( !me.isFolded ) {
} else { if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
if ( !$target.hasClass('active') && !islone ) { me.dblclick_timer = setTimeout(function () {
me.setTab(tab); me.dblclick_el = tab;
me.processPanelVisible(null, true); delete me.dblclick_timer;
},500);
}
} }
} }
}, },
@ -292,12 +301,6 @@ define([
$tp.addClass('active'); $tp.addClass('active');
} }
if ( me.dblclick_timer ) clearTimeout(me.dblclick_timer);
me.dblclick_timer = setTimeout(function () {
me.dblclick_el = tab;
delete me.dblclick_timer;
},300);
this.fireEvent('tab:active', [tab]); this.fireEvent('tab:active', [tab]);
} }
}, },