Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(sheet change arrow): fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tubiaoge committed Jul 31, 2020
1 parent 3e3bf75 commit 4a7850b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/controllers/pivotTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ const pivotTable = {

$("#luckysheet-dialog-pivotTable-range").html(getRangetxt(_this.pivotDataSheetIndex, _this.pivot_select_save));
$("#luckysheet-modal-dialog-slider-pivot").show();
sheetmanage.sheetBarShowAndHide();

luckysheetsizeauto();
},
getComposeArray: function (data) {
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import luckysheetFreezen from './freezen';
import { luckysheetrefreshgrid } from '../global/refresh';
import Store from '../store';
import locale from '../locale/locale';
import sheetmanage from './sheetmanage';

let gridW = 0,
gridH = 0;
Expand Down Expand Up @@ -167,4 +168,7 @@ export default function luckysheetsizeauto() {
}, function(){
$(this).prev(".luckysheet-toolbar-button-split-left").removeClass("luckysheet-toolbar-button-hover");
});

sheetmanage.sheetArrowShowAndHide();
sheetmanage.sheetBarShowAndHide();
}
12 changes: 1 addition & 11 deletions src/controllers/sheetBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,7 @@ export function initialSheetBar(){
}
}

let winW = $(window).width();

let c_width = 0;
$("#luckysheet-sheet-container-c > div.luckysheet-sheets-item:visible").each(function(){
c_width += $(this).outerWidth();
});

if (c_width >= winW * 0.7) {
$("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "inline-block");
$("#luckysheet-sheet-container .docs-sheet-fade-left").show();
}
sheetmanage.sheetArrowShowAndHide();

Store.luckysheetfile[index].name = txt;
server.saveParam("all", Store.currentSheetIndex, txt, { "k": "name" });
Expand Down
17 changes: 17 additions & 0 deletions src/controllers/sheetmanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,23 @@ const sheetmanage = {

this.sheetBarShowAndHide(index);
},
sheetArrowShowAndHide(){
let containerW = $("#luckysheet-sheet-container").width();

let c_width = 0;
$("#luckysheet-sheet-container-c > div.luckysheet-sheets-item:visible").each(function(){
c_width += $(this).outerWidth();
});

if (c_width >= containerW) {
$("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "inline-block");
$("#luckysheet-sheet-container .docs-sheet-fade-left").show();
}
else{
$("#luckysheet-sheet-area .luckysheet-sheets-scroll").css("display", "none");
$("#luckysheet-sheet-container .docs-sheet-fade-left").hide();
}
},
sheetBarShowAndHide(index){
let $c = $("#luckysheet-sheet-container-c");

Expand Down
4 changes: 3 additions & 1 deletion src/global/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ function jfrefreshgrid(data, range, cfg, cdformat, RowlChange, isRunExecFunction
server.historyParam(Store.flowdata, Store.currentSheetIndex, range[s]);
}
// 刷新图表
Store.chartparam.jfrefreshchartall(Store.flowdata,range[s].row[0],range[s].row[1],range[s].column[0],range[s].column[1])
if(typeof(Store.chartparam.jfrefreshchartall)=="function"){
Store.chartparam.jfrefreshchartall(Store.flowdata,range[s].row[0],range[s].row[1],range[s].column[0],range[s].column[1]);
}
}

//刷新表格
Expand Down

0 comments on commit 4a7850b

Please sign in to comment.