|
@@ -2560,29 +2560,6 @@ $(document).ready(() => {
|
|
$('a', '.right-nav').bind('click', function () {
|
|
$('a', '.right-nav').bind('click', function () {
|
|
//const main = $('#main-view'), tool = $('#tools-view');
|
|
//const main = $('#main-view'), tool = $('#tools-view');
|
|
const tab = $(this), tabPanel = $(tab.attr('content'));
|
|
const tab = $(this), tabPanel = $(tab.attr('content'));
|
|
- const showTools = function (show) {
|
|
|
|
- const left = $('#main-view'), right = $('#tools-view'), parent = left.parent();
|
|
|
|
- if (show) {
|
|
|
|
- right.show();
|
|
|
|
- autoFlashHeight();
|
|
|
|
- /**
|
|
|
|
- * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
|
|
|
|
- * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
|
|
|
|
- * 故需要通过最终的parent.width再计算一次left.width
|
|
|
|
- *
|
|
|
|
- * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
|
|
|
|
- * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
- //left.css('width', parent.width() - right.outerWidth());
|
|
|
|
- //left.css('width', parent.width() - right.outerWidth());
|
|
|
|
- const percent = 100 - right.outerWidth() /parent.width() * 100;
|
|
|
|
- left.css('width', percent + '%');
|
|
|
|
- } else {
|
|
|
|
- right.hide();
|
|
|
|
- left.css('width', '100%');
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
if (!tab.hasClass('active')) {
|
|
if (!tab.hasClass('active')) {
|
|
$('a', '.side-menu').removeClass('active');
|
|
$('a', '.side-menu').removeClass('active');
|
|
$('.tab-content .tab-select-show').removeClass('active');
|
|
$('.tab-content .tab-select-show').removeClass('active');
|
|
@@ -2682,7 +2659,7 @@ $(document).ready(() => {
|
|
} else {
|
|
} else {
|
|
tab.removeClass('active');
|
|
tab.removeClass('active');
|
|
tabPanel.removeClass('active');
|
|
tabPanel.removeClass('active');
|
|
- showTools(tab.hasClass('active'));
|
|
|
|
|
|
+ showSideTools(tab.hasClass('active'));
|
|
}
|
|
}
|
|
slSpread.refresh();
|
|
slSpread.refresh();
|
|
spSpread.refresh();
|
|
spSpread.refresh();
|