|
@@ -1352,33 +1352,40 @@ $(document).ready(() => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ const showSideTools = function (show) {
|
|
|
+ const left = $('#left-view'), right = $('#right-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 {
|
|
|
+ left.width(parent.width());
|
|
|
+ right.hide();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $('#content-tab').addClass('active');
|
|
|
+ $('#xd-content').addClass('active');
|
|
|
+ showSideTools(true);
|
|
|
+ billsSpread.refresh();
|
|
|
+ if (posSpread) {
|
|
|
+ posSpread.refresh();
|
|
|
+ }
|
|
|
// 展开收起标准节点
|
|
|
$('a', '#side-menu').bind('click', function (e) {
|
|
|
e.preventDefault();
|
|
|
const tab = $(this), tabPanel = $(tab.attr('content'));
|
|
|
- const showSideTools = function (show) {
|
|
|
- const left = $('#left-view'), right = $('#right-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 {
|
|
|
- left.width(parent.width());
|
|
|
- right.hide();
|
|
|
- }
|
|
|
- };
|
|
|
// 展开工具栏、切换标签
|
|
|
if (!tab.hasClass('active')) {
|
|
|
const close = $('.active', '#side-menu').length === 0;
|