Skip to content

Commit

Permalink
Merge pull request dream-num#56 from javahuang/master
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
DR-Univer authored Oct 13, 2020
2 parents 8a916b3 + 620a957 commit a4f1ad3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/controllers/constant.js

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

2 changes: 1 addition & 1 deletion src/controllers/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ export function keyboardInitial(){

selectHightlightShow();
}
else if (kcode == keycode.DELETE) {
else if (kcode == keycode.DELETE || kcode == keycode.BACKSPACE) {
if(imageCtrl.currentImgId != null){
imageCtrl.removeImgItem();
}
Expand Down
29 changes: 26 additions & 3 deletions src/controllers/menuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ const menuButton = {
//luckysheet-icon-fmt-other-menuButton_sub
$("body").append(menu+submenu);
$menuButton = $("#" + menuButtonId).width(250);
_this.focus($menuButton);

$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
luckysheetContainerFocus();

let $t = $(this), itemvalue = $t.attr("itemvalue");
let $t = $(this), itemvalue = $t.attr("itemvalue"),itemname = $t.attr("itemname");;
$("#luckysheet-icon-fmt-other").find(".luckysheet-toolbar-menu-button-caption").html(" "+ itemname +" ");

if(itemvalue == "fmtOtherSelf"){
return;
Expand All @@ -459,6 +459,12 @@ const menuButton = {
luckysheetMoreFormat.createDialog(itemvalue);
luckysheetMoreFormat.init();
})
} else {
const text =$(this).find(".luckysheet-toolbar-menu-button-caption").text().trim();
const format = locale_defaultFmt.find(f => f.text === text);
if(format) {
_this.focus($menuButton, format.value);
}
}

let userlen = $(this).outerWidth();
Expand Down Expand Up @@ -3520,6 +3526,23 @@ const menuButton = {
$icon.removeAttr("class").addClass("luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-" + itemvalue + iconfontObject[itemvalue]);
$menuButton.hide();
}
else if(attr == "ct") {
let $menuButton = $("#luckysheet-icon-fmt-other");
const _locale = locale();
const locale_defaultFmt = _locale.defaultFmt;
if(!foucsStatus) {
$menuButton.find(".luckysheet-toolbar-menu-button-caption").html(" "+ locale_defaultFmt[0].text +" ");
return;
}
const {fa} = foucsStatus;
const format = locale_defaultFmt.find(f => f.value === fa);
if(format) {
$menuButton.find(".luckysheet-toolbar-menu-button-caption").html(" "+ format.text +" ");
} else {
const otherFormat = locale_defaultFmt.find(f => f.value === "fmtOtherSelf");
$menuButton.find(".luckysheet-toolbar-menu-button-caption").html(" "+ otherFormat.text +" ");
}
}
},
inputMenuButtonFocus:function(focusTarget){
var w = window.getSelection();
Expand All @@ -3537,7 +3560,7 @@ const menuButton = {
},
menuButtonFocus: function(d, r, c){
let _this = this;
let foucsList = ["bl", "it", "cl", "ff", "ht", "vt", "fs", "tb", "tr"];
let foucsList = ["bl", "it", "cl", "ff", "ht", "vt", "fs", "tb", "tr", "ct"];
const _locale = locale();
for(let i = 0; i < foucsList.length; i++){
let attr = foucsList[i];
Expand Down
4 changes: 3 additions & 1 deletion src/css/iconCustom.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#luckysheet-icon-morebtn{
position: absolute;
right: 30px;
right: 15px;
transform: translate(0,-50%);
top: 50%;
}


Expand Down
9 changes: 9 additions & 0 deletions src/css/luckysheet-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@
top: -1660px;
} */

#luckysheet-icon-fmt-other .luckysheet-toolbar-menu-button-caption {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 55px;
margin-left: 1px;
text-align: center;
}

#luckysheet-icon-font-family .luckysheet-toolbar-menu-button-caption {
overflow: hidden;
text-overflow: ellipsis;
Expand Down

0 comments on commit a4f1ad3

Please sign in to comment.