From f3e5fe5cd676edc198ad7d7550d8d0b79e0c1114 Mon Sep 17 00:00:00 2001 From: nikita_bartoshuk Date: Wed, 23 Jul 2025 12:07:04 +0300 Subject: [PATCH 1/3] added autofit in right menu --- .../main/app/template/TableSettings.template | 19 ++++------- .../main/app/view/TableSettings.js | 33 +++++++++++++++++-- apps/documenteditor/main/locale/en.json | 1 + 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/apps/documenteditor/main/app/template/TableSettings.template b/apps/documenteditor/main/app/template/TableSettings.template index d64726d969..e3858ed7d4 100644 --- a/apps/documenteditor/main/app/template/TableSettings.template +++ b/apps/documenteditor/main/app/template/TableSettings.template @@ -127,12 +127,7 @@ -
- - - - - +
@@ -142,12 +137,7 @@ -
- - - - -
+
@@ -155,6 +145,11 @@
+ + +
+ +
diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 40f2a4a77e..f97043a695 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -146,6 +146,15 @@ define([ this.fireEvent('editcomplete', this); }, + onCheckAutofitChange: function(field, newValue, oldValue, eOpts) { + if (this.api) { + var properties = new Asc.CTableProp(); + properties.put_TableLayout((field.getValue()=='checked') ? Asc.c_oAscTableLayout.AutoFit : Asc.c_oAscTableLayout. Fixed); + this.api.tblApply(properties); + } + this.fireEvent('editcomplete', this); + }, + onColorsBackSelect: function(btn, color) { this.CellColor = {Value: 1, Color: color}; @@ -296,6 +305,16 @@ define([ }); this.lockedControls.push(this.chColBanded); + this.chAutofit = new Common.UI.CheckBox({ + el: $('#table-checkbox-autofit'), + labelText: this.textAutofit, + dataHint: '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.chAutofit.on('change', _.bind(this.onCheckAutofitChange, this)); + this.lockedControls.push(this.chAutofit); + this.chHeader.on('change', _.bind(this.onCheckTemplateChange, this, 0)); this.chTotal.on('change', _.bind(this.onCheckTemplateChange, this, 1)); this.chBanded.on('change', _.bind(this.onCheckTemplateChange, this, 2)); @@ -471,7 +490,13 @@ define([ }, this)); this.btnAddFormula = new Common.UI.Button({ - el: $('#table-btn-add-formula') + parentEl: $('#table-btn-add-formula'), + cls: 'btn-toolbar align-left', + iconCls: 'toolbar__icon btn-table-to-text', + caption : this.textAddFormula, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'medium' }); this.lockedControls.push(this.btnAddFormula); this.btnAddFormula.on('click', _.bind(this.onAddFormula, this)); @@ -615,6 +640,9 @@ define([ this._state.RepeatRow=value; } this.chRepeatRow.setDisabled(this._state.RepeatRow === null || this._locked); + var autoFit = props.get_TableLayout(); + this.chAutofit.setDisabled(autoFit===undefined); + this.chAutofit.setValue(autoFit===Asc.c_oAscTableLayout.AutoFit, true); } }, @@ -987,7 +1015,8 @@ define([ onEyedropperEnd: function () { this.fireEvent('eyedropper', false); - } + }, + textAutofit: 'Automaticaly resize to fit content' }, DE.Views.TableSettings || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index d3edeaac90..b1de5b69ec 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -3437,6 +3437,7 @@ "DE.Views.TableSettings.txtTable_ListTable": "List table", "DE.Views.TableSettings.txtTable_PlainTable": "Plain table", "DE.Views.TableSettings.txtTable_TableGrid": "Table grid", + "DE.Views.TableSettings.textAutofit": "Automaticaly resize to fit content", "DE.Views.TableSettingsAdvanced.textAlign": "Alignment", "DE.Views.TableSettingsAdvanced.textAlignment": "Alignment", "DE.Views.TableSettingsAdvanced.textAllowSpacing": "Spacing between cells", From 02d4f398fa05d4baeff014cec5961ab205315c7a Mon Sep 17 00:00:00 2001 From: nikita_bartoshuk Date: Mon, 4 Aug 2025 15:57:24 +0300 Subject: [PATCH 2/3] fixed icons and locks --- .../documenteditor/main/app/view/TableSettings.js | 7 +++---- .../resources/img/toolbar/1.25x/btn-function.png | Bin 0 -> 542 bytes .../resources/img/toolbar/1.5x/btn-function.png | Bin 0 -> 580 bytes .../resources/img/toolbar/1.75x/btn-function.png | Bin 0 -> 829 bytes .../resources/img/toolbar/1x/btn-function.png | Bin 0 -> 449 bytes .../resources/img/toolbar/2.5x/btn-function.svg | 4 ++++ .../resources/img/toolbar/2x/btn-function.png | Bin 0 -> 873 bytes .../img/toolbar/v2/1.25x/btn-function.png | Bin 0 -> 372 bytes .../img/toolbar/v2/1.5x/btn-function.png | Bin 0 -> 460 bytes .../img/toolbar/v2/1.75x/btn-function.png | Bin 0 -> 563 bytes .../resources/img/toolbar/v2/1x/btn-function.png | Bin 0 -> 353 bytes .../img/toolbar/v2/2.5x/btn-function.svg | 3 +++ .../resources/img/toolbar/v2/2x/btn-function.png | Bin 0 -> 582 bytes 13 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 apps/documenteditor/main/resources/img/toolbar/1.25x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/1.5x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/1.75x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/1x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/2.5x/btn-function.svg create mode 100644 apps/documenteditor/main/resources/img/toolbar/2x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/1.25x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/1.5x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/1.75x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/1x/btn-function.png create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/2.5x/btn-function.svg create mode 100644 apps/documenteditor/main/resources/img/toolbar/v2/2x/btn-function.png diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index f97043a695..4125c01506 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -492,10 +492,10 @@ define([ this.btnAddFormula = new Common.UI.Button({ parentEl: $('#table-btn-add-formula'), cls: 'btn-toolbar align-left', - iconCls: 'toolbar__icon btn-table-to-text', + iconCls: 'toolbar__icon btn-function', caption : this.textAddFormula, dataHint: '1', - dataHintDirection: 'bottom', + dataHintDirection: 'left', dataHintOffset: 'medium' }); this.lockedControls.push(this.btnAddFormula); @@ -641,7 +641,7 @@ define([ } this.chRepeatRow.setDisabled(this._state.RepeatRow === null || this._locked); var autoFit = props.get_TableLayout(); - this.chAutofit.setDisabled(autoFit===undefined); + this.chAutofit.setDisabled(autoFit === undefined || this._locked); this.chAutofit.setValue(autoFit===Asc.c_oAscTableLayout.AutoFit, true); } }, @@ -1017,6 +1017,5 @@ define([ this.fireEvent('eyedropper', false); }, - textAutofit: 'Automaticaly resize to fit content' }, DE.Views.TableSettings || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/1.25x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..e53a8dd3646f8951e8261d825ffbf83b28082c68 GIT binary patch literal 542 zcmV+(0^$9MP)X1^@s6b5wmq00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yPLBhQbU+Dq2QI-SxCGLHOHeu>9VmC!GM0rVF+Y0ao4GM8nA349 z31DMmV{MGYMdBcFlc=yV-g_f)kvK@)Bv#L1Bs%`;!?loitO$$f_*=1%RdXm;iBA+n z27Q$%n!{=ygl-f;3a~z4Pyn@1E#VNXWD-4h?<8oUTEfvvCf0NJrq6i8|LC7S5DNI_ zv1%>Cd^z&I29IK=GRnch-gC(Dkwr8Ma@?^9w%RAUCg?eUmfEZpCbHE&(T@^6Cx1(A z_9`|EIK?6qc*a780cZ4~z&~@mVlBl=d}Vaieh}=i6r0Pj+wE4%p>5Q+-e#^Dgidu> z04J~?tdm?bwAP{=itgZANNzRKc5Ct;3*Zj!bE}bBN(;={ZYnxh7oBS|?NWo#5sOf$ zjkHN{ur4~U*`Bh97S6b#0@d4=&3 zo6}x`Z~SRDXE&@}949>HL5DJ*>8EHObiTl6x}sj!l}J5nPyl+p g)Q*w`q}FLF<7hnCala{vGU07*qoM6N<$f=0jS+5i9m literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/1.5x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..94538b2eea34c7d59cc73b76ba2156a3a9b135d3 GIT binary patch literal 580 zcmV-K0=xZ*P)i z!Y~kpUphfHs5dAZ;0@Xhk`15}gbf%0bpl49Oh7jX8^8wX9eycpWe`z}TdDq}lkHrj z<9vS+KqiyPWd1G%#_=NZC}MbiMFP66`)0Q&iX?UyA`SPoNQ(rBvkQ@i`&uN4T_bY9 zIkHI*=ZwffS0rX5vO;3S(TzxQyK}WI@{ELtqw~&@%&rkx!=Q^J);+*0W zo=4Xg(|FBPR#qaG^{WwY`xKXT!gJKR-oZKOW8f}g$-OoejYNe=h!ZhrkC6| zngJrw?3QrRodt9n@fLTeZE>JvbY}tGic!5wZR`9~ho=EuP2B{M(YZ^9rvY6}-A#5M zFbqx8qsTU(`{4S7_?+y@2gYc-Lmjpv?-z8MZhO8H8~Yn}4P45G8p53VzK;9%ON@lg zs0%eBjw;jFvG@K(yF(&uxo*94!&NV0Po06Qb^U=yjK}(RIg+#+pX^GS?|Zxa#;)X9 z47;Zp?2m;SZWQ^QQ*XBAyQ8D4a0YL@bInmS^PZLL)az@}9f~>&jKL; literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/1.75x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..6b1c862910f3c5badb61e39f77319cef274739ed GIT binary patch literal 829 zcmV-D1H$}?P)2D=(|YAR5Bc&HuT!wC*}lQQA>q4T|Hg<&P=YV4kPBb9KB_MSuZ%4c!$BccMsi<- z5-;^QNaljeR(D@OD%87k+c-4M@`YM z_!2Wkw~_Shj8oT;KQB$+90Q=~Sy=Y;$ut9nzBvYf(5x?gk^j)XVV&6_GOjrrxjq$e z+lTfI>&#ugJUW$fEf46PuhK`-^a=i(j9}AatZjQ9d@(2K3sfDou0MbI;vya)WUtUZ z1`zy?woqs7pVjP6H-wYf*Sqm^$mxgB^bgDrxR5Q%U;B6Dwn%i{sHo(a3) z3K2JXt~no(xwkNbKeh+%nq6>p&nE9)LIAGqFyGL9m?ZdxI$Aa`0oY$@dvhI!NmbO+ zMb1p}4fWQhZWMT6?`^fDM5e?Z{{T8AlK7Ite`2t8StAG|ql@UORj*R1rABiyCU~_F z65#x)IGl{bX9Pkbw(tts=`|q{9E7bZWT)4JiHV7ciT{&7V~>IqTt!ZQ00000NkvXX Hu0mjfRtaP8 literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/1x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/1x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..09676cf01df0c6f2aa1173b3dacda726e7181268 GIT binary patch literal 449 zcmV;y0Y3hTP)s4IYFPWJM42)7E#Q%FAIU zo^K!KoHtuQ+JJHe0S@nhML~MaO(b3Ck_Xc+Og1IR^7xV7rdj1;3V`KeptwCLP zpI2V;fxlxX2zDsi?-kRi*%#aw8o1q>)9ejyeSY)*9=AF9Wm(p<*b6_&pZxTh06!ey zZVzPxx4Ux2hH-&F + + + diff --git a/apps/documenteditor/main/resources/img/toolbar/2x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/2x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..5448e5a892611bc9645bcccb134dcec217d33a52 GIT binary patch literal 873 zcmV-v1D5=WP)

Age} zd5W+l*+3$ZNF)-8ZP+0U1<5nXUlK*~o8%3VptUaG#kbq--Vgzbq$VjHT|=Tt_ShIo zoFb`7N=Mh|j?LrC&?T$(^sH;qC3iC@L7610_Vlc4Il0)F3f)RmJ+=%RLkX&6rKuj< z=JDm|l2;=_C_%X-FUt5B4vZ7{f(Vhi$3z)lfi8JN+jmpA<7$gSWaO}2c4&KWec6xL zg47_{y3M2QE6rv9$QGhTUSJbvq!k^H2sz2s^ErCIk;^k${1$`$@Wn}-p%q;ziM@J0 zNAEXsd4^duK8D}O6FzU>gXrA1rATi0nk0U%9kBfvSvgPM_C1I$bNqNNy!lCz=h{Bo z(wtyd-w+Bm$+>)QVC!YD5rY2s$*jHyKFUdQF5eqdFLmG%$8_K8M88r#E3AOieXkS! zO8Km?5@uzMjR)ln-^FlN*2{=rIn{Sba@eHoXZWr%^=mskGy567tDQ>Bs+v+@GuQ+^ zV+EX5H5#8Z9mA~ne&PF=xB6#-Z-MUWh{>@IQOD=5sIi)%V6V7VIWK!FYOMaNxOHannnOuAItf%GzLg~L*jESjNKO3i7B+Q)x5vi=zgMxdygPcc zy%fnA%X5#9Zkj)aoG3Z};}f5Ec=1W{L&SGKL7Y522V~~FT>MwQ5fF7?%B8Lv7blmKSqB(St!reIJTz8etu+MiUPyU;3#@d zRA2329k0F;;cj4xp=Ka;u9ie)J@!miU#SDmgM2Jn^+YiT-QBW`cHb>Aw00000NkvXXu0mjfE8?0q literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/v2/1.25x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/v2/1.25x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..4e2f806599faa88dde1de7f29f6fea8ef7e7a145 GIT binary patch literal 372 zcmV-)0gL{LP)rOP~Z_5)V010v#+RqyxKyxPxp5TY^iV1dbbql_-J8_Q?1+aM;yK{#*d* z>5VNI(VRK+vf2jLKWM91EpFpH7vTIT#Gd<2yjhh?gEK@E3tyPmJJH$ z_Y#AFv=39pqQSHeQz!o|hO#`f^4`nZ&eEr@OQ(Mek- zMtdg~JMMLIq^rpKmF&D;3`Vt}z*Q+tY=goImhNmHrLGcBm_qdWd^nzYasB}czQyfU S8+2I!00000004#Nklqa0k~oZB|wE1 z3g8u6D1p4nFDSt4Iu^-+TFVX!FzT^`5}-i?1(?ia$_PENDI)ab{2U|<@uHlD=MXQ- zm9nUy0BpU25+I?79p`@5D5OggqCv#9o5kk*c44s2J!y01TT28VA~LErm?oVBYo zMC$vt?eUiIgt~2W^PP!e+rMrpLjA`TApc;BNO!5A0N!z4&bdOh zlrTXSbLG`i!UT{jL>SPb$o{k^4r~W;{7xPmycgfL>g literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/v2/1.75x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/v2/1.75x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..8e466fbd9f2fbb3932484156cee329199e129fc2 GIT binary patch literal 563 zcmV-30?hr1P)KnZ!>dGp#5D1j2vLFgdqfOL>_Knawv&wz=vCHS(eh;@+9qIun6f7nGD zjVzBnu-jsbEw)$&S!zf~OiLvSbFkd7ys~8!rYT4?F;x44MH57o9ErKu?DbTkh_Ykp zF7AcdS0JK?JqfuTG9`8i96n4hzB|A6R{ZoUJB(tUt2ci*1G zW?-V8#b;H|Vh*S9_K^cD$#^GZqfa#jz>>r}8Eo{aeF5@L zRE35Zo1g-Dr|3&PyRcj#mPGeec!RMdy02E7mG5J4_aBJX>xp(pmhJ;4*Gd%Nom50o zR0!{+B2rNSEXgFINmK|+GKpvsRl3Q$k$e@iffYrhqRJD+bYpq`!t{9*k&4PEkEcd! z_Hp1}(+55`TC>@}*NVFpmgKO9tx%=4pWQf@zCx*tBC(k{qdt|nj3V*ba0XaAC8}u( z6w#Qvc_36xJJM{(0>3=lk!Ca4?Qh-|TWs-%;s?f^1*`@m2Pyyn002ovPDHLkV1f%r B05AXm literal 0 HcmV?d00001 diff --git a/apps/documenteditor/main/resources/img/toolbar/v2/1x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/v2/1x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..8758d5af428868390534282ca95d239d4ce73f2d GIT binary patch literal 353 zcmV-n0iOPeP)evuwqXe(kg7?i48Yf_+ZfN zNx+_mX+)L{k6{`?+KhN@buU*TYZ^z + + diff --git a/apps/documenteditor/main/resources/img/toolbar/v2/2x/btn-function.png b/apps/documenteditor/main/resources/img/toolbar/v2/2x/btn-function.png new file mode 100644 index 0000000000000000000000000000000000000000..ea010a86c3348cadac0bd926b4ac6c0490506aa8 GIT binary patch literal 582 zcmV-M0=fN(P)O!X9Ib5 z{!Z%+&~9;Hbh?izg@|?|9`BM1MK0Rg)4FcJ!GuNk6Gg`k=z&u z2y}m^FClE6)7D9=(nS=K!S|#{l{+z(&Om<9QJSb9OqDFqqD*}(m@^pg0%P3yO`^Z$LwR`jYkDd{xDVVt^C+(h%N*K8)l6H@QN@#!sGIumUN`H{K|3#+t zEnnhVmSoOSkZ~z8tAJN-{uhIz%@BAonE&k#DF^gd6CIvGMVH22E`^j Uk;3g|iU0rr07*qoM6N<$g7?%6f&c&j literal 0 HcmV?d00001 From 1cae2390ae53fa505d2f780926b105ebcc0282fe Mon Sep 17 00:00:00 2001 From: nikita_bartoshuk Date: Mon, 4 Aug 2025 16:37:51 +0300 Subject: [PATCH 3/3] fixed btn hover layout --- apps/documenteditor/main/resources/less/rightmenu.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/main/resources/less/rightmenu.less b/apps/documenteditor/main/resources/less/rightmenu.less index 831022c9b5..793c08217b 100644 --- a/apps/documenteditor/main/resources/less/rightmenu.less +++ b/apps/documenteditor/main/resources/less/rightmenu.less @@ -62,7 +62,7 @@ display: inline-block; } - #table-btn-convert-to-text { + #table-btn-convert-to-text, #table-btn-add-formula { .btn { width: 100%; }