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

Commit

Permalink
fix(a few bug fix): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer committed Aug 30, 2020
1 parent bbaafe0 commit f07e25d
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ export default function luckysheetHandler() {
});

//表格mousemove
$(document).mousemove(function (event) {
$(document).on("mousemove.luckysheetEvent",function (event) {
luckysheetPostil.overshow(event); //有批注显示

window.cancelAnimationFrame(Store.jfautoscrollTimeout);
Expand Down Expand Up @@ -2181,7 +2181,7 @@ export default function luckysheetHandler() {
}
});
//表格mouseup
$(document).mouseup(function (event) {
$(document).on("mouseup.luckysheetEvent",function (event) {
//数据窗格主体
if (Store.luckysheet_select_status) {
clearTimeout(Store.countfuncTimeout);
Expand Down Expand Up @@ -3505,7 +3505,7 @@ export default function luckysheetHandler() {
});

//截图下载
$(document).on("click", "a.download", function () {
$(document).on("click.luckysheetEvent", "a.download", function () {
let dataURI = $("#luckysheet-confirm-screenshot-save img").attr("src");
const locale_screenshot = _locale.screenshot;
let binStr = atob(dataURI.split(",")[1]),
Expand Down Expand Up @@ -3673,9 +3673,9 @@ export default function luckysheetHandler() {
}
}

$(document).on("visibilitychange webkitvisibilitychange msvisibilitychange", copychange).mouseleave(function () {
$(document).on("visibilitychange.luckysheetEvent webkitvisibilitychange.luckysheetEvent msvisibilitychange.luckysheetEvent", copychange).on("mouseleave.luckysheetEvent", function () {
Store.iscopyself = false;
}).mousedown(function (event) {
}).on("mousedown.luckysheetEvent", function (event) {
//有批注在编辑时
luckysheetPostil.removeActivePs();

Expand Down Expand Up @@ -3722,7 +3722,7 @@ export default function luckysheetHandler() {


//模态框拖动
$(document).on("mousedown", "div.luckysheet-modal-dialog", function (e) {
$(document).on("mousedown.luckysheetEvent", "div.luckysheet-modal-dialog", function (e) {
if (!$(e.target).is(".luckysheet-modal-dialog")) {
return;
}
Expand All @@ -3735,7 +3735,7 @@ export default function luckysheetHandler() {
});

//模态框关闭
$(document).on("click", ".luckysheet-modal-dialog-title-close, .luckysheet-model-close-btn", function (e) {
$(document).on("click.luckysheetEvent", ".luckysheet-modal-dialog-title-close, .luckysheet-model-close-btn", function (e) {
//选择文本颜色和单元格颜色弹出框取消
if ($("#textcolorselect").is(":visible") || $("#cellcolorselect").is(":visible")) {
$("#luckysheet-conditionformat-dialog").show();
Expand Down Expand Up @@ -3931,7 +3931,7 @@ export default function luckysheetHandler() {
let dpi_y = document.getElementById('testdpidiv').offsetHeight * Store.devicePixelRatio;

//粘贴事件处理
$(document).on("paste", function (e) {
$(document).on("paste.luckysheetEvent", function (e) {
if (isEditMode()) {//此模式下禁用粘贴
return;
}
Expand Down Expand Up @@ -4081,7 +4081,7 @@ export default function luckysheetHandler() {

let bg = $td.css("background-color");
if (bg == "rgba(0, 0, 0, 0)") {
bg = "rgba(255,255,255)";
bg = null;
}

cell.bg = bg;
Expand Down
7 changes: 6 additions & 1 deletion src/controllers/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ const server = {
let v_row = [];

for(let c = c1; c <= c2; c++){
v_row.push(data[r][c]);
if(data[r]==null){
v_row.push(null);
}
else{
v_row.push(data[r][c]);
}
}

v.push(v_row);
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/updateCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu


export function setCenterInputPosition(row_index, col_index, d){

if(row_index==null ||col_index==null){
return;
}
let cell = d[row_index][col_index];
if(cell==null){
return;
Expand Down
2 changes: 2 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ luckysheet.create = function (setting) {
luckysheetConfigsetting.defaultColWidth = extendsetting.defaultColWidth;
luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight;

luckysheetConfigsetting.title = extendsetting.title;

// Register plugins
initPlugins(extendsetting.plugins , extendsetting.data);

Expand Down
2 changes: 2 additions & 0 deletions src/global/createdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,6 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit

//批注
luckysheetPostil.buildAllPs(Store.flowdata);

$("#luckysheet_info_detail_input").val(luckysheetConfigsetting.title);
}
4 changes: 3 additions & 1 deletion src/global/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,10 @@ let cellRender = function(r, c, start_r, start_c, end_r, end_c, value, luckyshee
luckysheetTableContent.fillStyle = fillStyle;
}

let borderfix = menuButton.borderfix(Store.flowdata, r, c);


let borderfix = menuButton.borderfix(Store.flowdata, r, c);
// console.log(value, fillStyle,borderfix);
let cellsize = [
(start_c + offsetLeft + borderfix[0]),
(start_r + offsetTop + borderfix[1]),
Expand Down
4 changes: 4 additions & 0 deletions src/global/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ const method = {
$("#luckysheet-modal-dialog-mask, #luckysheetTextSizeTest, #luckysheet-icon-morebtn-div").remove();
$("#luckysheet-input-box").parent().remove();
$("#luckysheet-formula-help-c").remove();
$(".chartSetting").remove();

//document event release
$(document).off(".luckysheetEvent");

//参数重置
Store.jfredo = [];
Expand Down
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

luckysheet.create({
container: 'luckysheet',
title:"hehehahahehe ",
lang: 'en',
allowEdit:true,
forceCalculation:false,
Expand Down

0 comments on commit f07e25d

Please sign in to comment.