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

Commit

Permalink
fix(feature): functionButton
Browse files Browse the repository at this point in the history
1.fix functionButton 2.remove undefined request 3.add rangePasteBefore hook

fix #336 fix #381
  • Loading branch information
Dushusir committed Dec 22, 2020
1 parent 9357792 commit 5983cb0
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 10 deletions.
10 changes: 10 additions & 0 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ Use note:

Pay special attention to the setting of `range` in `setting` only when `isRange` is set to `true`, which is different from the general range format.

If you want to use this API to set the freeze after the workbook is initialized, you can execute it in the hook function after the workbook is created, such as:
```js
luckysheet.create({
hook:{
workbookCreateAfter:function(){
luckysheet.setBothFrozen(false);
}
}
});

- **Usage**:

- Frozen ranks
Expand Down
12 changes: 12 additions & 0 deletions docs/zh/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,18 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
冻结行列操作

特别注意,只有在`isRange`设置为`true`的时候,才需要设置`setting`中的`range`,且与一般的range格式不同。

如果想在工作簿初始化后使用此API设置冻结,可以在工作簿创建后的钩子函数中执行,比如:
```js
luckysheet.create({
hook:{
workbookCreateAfter:function(){
luckysheet.setBothFrozen(false);
}
}
});

```

- **示例**:

Expand Down
17 changes: 9 additions & 8 deletions src/controllers/constant.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5294,6 +5294,12 @@ export default function luckysheetHandler() {

const locale_fontjson = locale().fontjson;


// hook
if(!method.createHookFunction('rangePasteBefore',Store.luckysheet_select_save,txtdata)){
return;
}

if (txtdata.indexOf("luckysheet_copy_action_table") > - 1 && Store.luckysheet_copy_save["copyRange"] != null && Store.luckysheet_copy_save["copyRange"].length > 0 && isEqual) {
//剪切板内容 和 luckysheet本身复制的内容 一致
if (Store.luckysheet_paste_iscut) {
Expand Down
2 changes: 1 addition & 1 deletion src/css/luckysheet-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
.luckysheet_info_detail_save {
color: #828282;
font-size: 12px;
margin-left: 5px;
margin:0 5px;
}

.luckysheet-share-logo {
Expand Down
3 changes: 3 additions & 0 deletions src/global/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ const method = {
dataVerificationCtrl[key] = defaultDataVerification[key];
}
}

// remove proxy
Store.asyncLoad = ['core'];
},
editorChart:function(c){
let chart_selection_color = luckyColor[0];
Expand Down
6 changes: 5 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
loadUrl: location.origin + "/luckysheet/api/load",
loadSheetUrl: location.origin + "/luckysheet/api/loadsheet"
}
}else{
}else{
// http://localhost:3000/
options = {
container: 'luckysheet',
Expand Down Expand Up @@ -165,6 +165,10 @@
workbookCreateAfter:function(json){
// console.info(json)
},
rangePasteBefore:function(range,data){
// console.info('rangePasteBefore',range,data)
// return false; //Can intercept paste
},


},
Expand Down

0 comments on commit 5983cb0

Please sign in to comment.