Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
OVSharova committed Sep 14, 2023
1 parent 94f4972 commit 75409eb
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions apps/spreadsheeteditor/main/app/view/CellEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ define([
this.$btnexpand = $('#ce-btn-expand', this.el);
this.$btnfunc = $('#ce-func-label', this.el);
this.$cellcontent = $('#ce-cell-content', this.el);
this.$cellgroupname = this.$btnexpand.parent();

var me = this;
this.$cellname.on('focus', function(e){
Expand Down Expand Up @@ -115,19 +116,23 @@ define([

cellEditorTextChange: function (){
if(!this.$cellcontent) return;
var btnexpandParent = this.$btnexpand.parent()[0];
if(this.$cellcontent[0].clientHeight != this.$cellcontent[0].scrollHeight) {
var scrollBarWidth = this.$cellcontent[0].offsetWidth - this.$cellcontent[0].clientWidth;
btnexpandParent.style.right = Common.UI.isRTL() ? '' : scrollBarWidth + "px";
btnexpandParent.style.left = Common.UI.isRTL() ? scrollBarWidth + "px" : '';

var cellcontent = this.$cellcontent[0];

if(cellcontent.clientHeight != cellcontent.scrollHeight) {
if(this._isScrollShow) return;
var scrollBarWidth = cellcontent.offsetWidth - cellcontent.clientWidth;
this.$cellgroupname.css({
'right': Common.UI.isRTL() ? '' : scrollBarWidth + "px",
'left': Common.UI.isRTL() ? scrollBarWidth + "px" : ''
});
this._isScrollShow = true;
}
else {
btnexpandParent.style.right = '';
btnexpandParent.style.left = '';
if(!this._isScrollShow) return;
this.$cellgroupname.css({'right': '', 'left': ''});
this._isScrollShow = false;
}

//Common.UI.isRTL() ?

},

tipFormula: 'Insert Function',
Expand Down

0 comments on commit 75409eb

Please sign in to comment.