From 5904c08e15446a69c8d880522ad81cb8ff61d4fe Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 29 Apr 2020 10:36:53 +0300 Subject: [PATCH] Refactoring button component --- apps/common/main/lib/component/Button.js | 3 +- apps/common/main/lib/component/Calendar.js | 4 +-- apps/common/main/lib/util/utils.js | 3 +- apps/common/main/lib/view/SignDialog.js | 4 +-- .../main/app/view/DocumentHolder.js | 2 +- .../main/app/view/DropcapSettingsAdvanced.js | 18 +++++----- .../main/app/view/HeaderFooterSettings.js | 2 +- .../main/app/view/ImageSettings.js | 10 +++--- .../main/app/view/ImageSettingsAdvanced.js | 16 ++++----- apps/documenteditor/main/app/view/Links.js | 6 ++-- .../main/app/view/MailMergeSettings.js | 10 +++--- .../app/view/ParagraphSettingsAdvanced.js | 2 +- .../main/app/view/ShapeSettings.js | 10 +++--- .../main/app/view/TableSettings.js | 4 +-- .../main/app/view/TableSettingsAdvanced.js | 14 ++++---- .../main/app/view/WatermarkSettingsDialog.js | 10 +++--- .../main/app/view/ChartSettings.js | 2 +- .../main/app/view/DocumentHolder.js | 2 +- .../main/app/view/ImageSettings.js | 10 +++--- .../main/app/view/ImageSettingsAdvanced.js | 2 +- .../main/app/view/ShapeSettings.js | 10 +++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 +- .../main/app/view/Statusbar.js | 2 +- .../main/app/view/TableSettings.js | 4 +-- .../main/app/controller/DocumentHolder.js | 4 +-- .../main/app/view/CellEditor.js | 2 +- .../main/app/view/CellSettings.js | 2 +- .../main/app/view/ChartSettings.js | 2 +- .../main/app/view/DataTab.js | 10 +++--- .../main/app/view/FileMenuPanels.js | 4 +-- .../main/app/view/FormulaTab.js | 24 ++++++------- .../main/app/view/HeaderFooterDialog.js | 36 +++++++++---------- .../main/app/view/ImageSettings.js | 12 +++---- .../main/app/view/PrintSettings.js | 4 +-- .../main/app/view/PrintTitlesDialog.js | 4 +-- .../main/app/view/ShapeSettings.js | 10 +++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 +- .../main/app/view/SortDialog.js | 4 +-- .../main/app/view/Spellcheck.js | 6 ++-- .../main/app/view/TableSettings.js | 2 +- 40 files changed, 140 insertions(+), 140 deletions(-) diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index 12eb656b7..fbc027ace 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -313,7 +313,8 @@ define([ if (me.options.el) { me.render(); - } + } else if (me.options.parentEl) + me.render(me.options.parentEl); }, render: function(parentEl) { diff --git a/apps/common/main/lib/component/Calendar.js b/apps/common/main/lib/component/Calendar.js index 71b282a13..2304ab1f5 100644 --- a/apps/common/main/lib/component/Calendar.js +++ b/apps/common/main/lib/component/Calendar.js @@ -91,17 +91,17 @@ define([ me.currentDate = me.options.date || new Date(); me.btnPrev = new Common.UI.Button({ + parentEl: me.cmpEl.find('#prev-arrow'), cls: '', iconCls: 'arrow-prev img-commonctrl' }); - me.btnPrev.render(me.cmpEl.find('#prev-arrow')); me.btnPrev.on('click', _.bind(me.onClickPrev, me)); me.btnNext = new Common.UI.Button({ + parentEl: me.cmpEl.find('#next-arrow'), cls: '', iconCls: 'arrow-next img-commonctrl' }); - me.btnNext.render(me.cmpEl.find('#next-arrow')); me.btnNext.on('click', _.bind(me.onClickNext, me)); me.cmpEl.on('keydown', function(e) { diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index b615bf323..57e933da4 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -830,6 +830,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, /x-huge/.test(el.className) && (_cls += ' x-huge icon-top'); var button = new Common.UI.Button({ + parentEl: $slots.eq(index), id: id + index, cls: _cls, iconCls: iconCls, @@ -839,7 +840,7 @@ Common.Utils.injectButtons = function($slots, id, iconCls, caption, lock, split, enableToggle: toggle || false, lock: lock, disabled: true - }).render( $slots.eq(index) ); + }); btnsArr.add(button); }); diff --git a/apps/common/main/lib/view/SignDialog.js b/apps/common/main/lib/view/SignDialog.js index 73e64e658..44524278a 100644 --- a/apps/common/main/lib/view/SignDialog.js +++ b/apps/common/main/lib/view/SignDialog.js @@ -188,12 +188,12 @@ define([ this.cmbFontSize.setValue(this.font.size); me.btnBold = new Common.UI.Button({ + parentEl: $('#id-dlg-sign-bold'), cls: 'btn-toolbar', iconCls: 'btn-bold', enableToggle: true, hint: me.textBold }); - me.btnBold.render($('#id-dlg-sign-bold')) ; me.btnBold.on('click', function(btn, e) { if (me.signObject) { me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, me.font.italic, btn.pressed); @@ -202,12 +202,12 @@ define([ }); me.btnItalic = new Common.UI.Button({ + parentEl: $('#id-dlg-sign-italic'), cls: 'btn-toolbar', iconCls: 'btn-italic', enableToggle: true, hint: me.textItalic }); - me.btnItalic.render($('#id-dlg-sign-italic')) ; me.btnItalic.on('click', function(btn, e) { if (me.signObject) { me.signObject.setText(me.inputName.getValue(), me.font.name, me.font.size, btn.pressed, me.font.bold); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 98bf4528f..f51e70a38 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -639,11 +639,11 @@ define([ me.cmpEl.append(pasteContainer); me.btnSpecialPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-special-paste'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-paste', menu : new Common.UI.Menu({items: []}) }); - me.btnSpecialPaste.render($('#id-document-holder-btn-special-paste')) ; } if (pasteItems.length>0) { diff --git a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js index bce7b1b98..a7a38058a 100644 --- a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js @@ -123,6 +123,7 @@ define([ [c_tableBorder.BORDER_NONE, '', 'btn-borders-large btn-adv-paragraph-none', '31'] ], function(item, index) { var _btn = new Common.UI.Button({ + parentEl: $('#drop-advanced-button-borderline-' + item[3]), posId : item[0], strId : item[1], iconCls : item[2], @@ -130,8 +131,7 @@ define([ cls : 'btn-options large' }); - _btn.render($('#drop-advanced-button-borderline-' + item[3])) - .on('click', function(btn) { + _btn.on('click', function(btn) { me._ApplyBorderPreset(btn.options.strId); }); }, this); @@ -301,6 +301,7 @@ define([ }, me)); this.btnNone = new Common.UI.Button({ + parentEl: $('#drop-advanced-button-none'), cls : 'btn huge-1 btn-options', iconCls : 'icon-advanced-wrap btn-drop-none', enableToggle: true, @@ -316,6 +317,7 @@ define([ }, me)); this.btnInText = new Common.UI.Button({ + parentEl: $('#drop-advanced-button-intext'), cls : 'btn huge-1 btn-options', iconCls : 'icon-advanced-wrap btn-drop-text', enableToggle: true, @@ -331,6 +333,7 @@ define([ }, me)); this.btnInMargin = new Common.UI.Button({ + parentEl: $('#drop-advanced-button-inmargin'), cls : 'btn huge-1 btn-options', iconCls : 'icon-advanced-wrap btn-drop-margin', enableToggle: true, @@ -393,6 +396,7 @@ define([ }, me)); this.btnFrameNone = new Common.UI.Button({ + parentEl: $('#frame-advanced-button-none'), cls : 'btn huge btn-options', iconCls : 'icon-right-panel btn-frame-none', enableToggle: true, @@ -408,6 +412,7 @@ define([ }, me)); this.btnFrameInline = new Common.UI.Button({ + parentEl: $('#frame-advanced-button-inline'), cls : 'btn huge btn-options', iconCls : 'icon-right-panel btn-frame-inline', enableToggle: true, @@ -423,6 +428,7 @@ define([ }, me)); this.btnFrameFlow = new Common.UI.Button({ + parentEl: $('#frame-advanced-button-flow'), cls : 'btn huge btn-options', iconCls : 'icon-right-panel btn-frame-flow', enableToggle: true, @@ -657,14 +663,6 @@ define([ } }, me)); - - this.btnNone.render($('#drop-advanced-button-none')); - this.btnInText.render($('#drop-advanced-button-intext')); - this.btnInMargin.render($('#drop-advanced-button-inmargin')); - this.btnFrameNone.render($('#frame-advanced-button-none')); - this.btnFrameInline.render($('#frame-advanced-button-inline')); - this.btnFrameFlow.render($('#frame-advanced-button-flow')); - this.on('show', _.bind(this.onShowDialog, this)); this.afterRender(); diff --git a/apps/documenteditor/main/app/view/HeaderFooterSettings.js b/apps/documenteditor/main/app/view/HeaderFooterSettings.js index 92adeac76..35d5c03b2 100644 --- a/apps/documenteditor/main/app/view/HeaderFooterSettings.js +++ b/apps/documenteditor/main/app/view/HeaderFooterSettings.js @@ -231,13 +231,13 @@ define([ this._btnsPosition = []; _.each(_arrPosition, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[3]), cls: 'btn-options huge bg-white', iconCls: item[2], posWhere:item[0], posAlign:item[1], hint: item[4] }); - _btn.render( $('#'+item[3])) ; _btn.on('click', _.bind(this.onBtnPositionClick, this)); this._btnsPosition.push( _btn ); this.lockedControls.push(_btn); diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 6cd24d0e8..e75ded1c3 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -195,47 +195,48 @@ define([ this.btnFitMargins.on('click', _.bind(this.setFitMargins, this)); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#image-button-270', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#image-button-270', me.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#image-button-90', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#image-button-90', me.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#image-button-flipv', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#image-button-flipv', me.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#image-button-fliph', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#image-button-fliph', me.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); var w = this.btnOriginalSize.cmpEl.outerWidth(); this.btnCrop = new Common.UI.Button({ + parentEl: $('#image-button-crop'), cls: 'btn-text-split-default', caption: this.textCrop, split: true, @@ -263,7 +264,6 @@ define([ }] }) }); - this.btnCrop.render( $('#image-button-crop')) ; this.btnCrop.on('click', _.bind(this.onCrop, this)); this.btnCrop.menu.on('item:click', _.bind(this.onCropMenu, this)); this.lockedControls.push(this.btnCrop); diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index ed324b137..53ba0cbfa 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -185,13 +185,13 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat }, this)); this.btnRatio = new Common.UI.Button({ + parentEl: $('#image-advanced-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#image-advanced-button-ratio')) ; this.btnRatio.on('click', _.bind(function(btn, e) { if (btn.pressed && this.spnHeight.getNumberValue()>0) { this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue(); @@ -399,6 +399,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat // Wrapping this.btnWrapInline = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-inline'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-inline', posId: Asc.c_oAscWrapStyle2.Inline, @@ -407,10 +408,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapInline.render( $('#image-advanced-button-wrap-inline')) ; this.btnWrapInline.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapSquare = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-square'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-square', posId: Asc.c_oAscWrapStyle2.Square, @@ -419,10 +420,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapSquare.render( $('#image-advanced-button-wrap-square')) ; this.btnWrapSquare.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapTight = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-tight'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-tight', posId: Asc.c_oAscWrapStyle2.Tight, @@ -431,10 +432,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapTight.render( $('#image-advanced-button-wrap-tight')) ; this.btnWrapTight.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapThrough = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-through'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-through', posId: Asc.c_oAscWrapStyle2.Through, @@ -443,10 +444,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapThrough.render( $('#image-advanced-button-wrap-through')) ; this.btnWrapThrough.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapTopBottom = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-topbottom'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-topbottom', posId: Asc.c_oAscWrapStyle2.TopAndBottom, @@ -455,10 +456,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapTopBottom.render( $('#image-advanced-button-wrap-topbottom')) ; this.btnWrapTopBottom.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapBehind = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-behind'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-behind', posId: Asc.c_oAscWrapStyle2.Behind, @@ -467,10 +468,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapBehind.render( $('#image-advanced-button-wrap-behind')) ; this.btnWrapBehind.on('click', _.bind(this.onBtnWrapClick, this)); this.btnWrapInFront = new Common.UI.Button({ + parentEl: $('#image-advanced-button-wrap-infront'), cls: 'btn-options huge-1', iconCls: 'icon-advanced-wrap btn-wrap-infront', posId: Asc.c_oAscWrapStyle2.InFront, @@ -479,7 +480,6 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat allowDepress: false, toggleGroup : 'imgAdvWrapGroup' }); - this.btnWrapInFront.render( $('#image-advanced-button-wrap-infront')) ; this.btnWrapInFront.on('click', _.bind(this.onBtnWrapClick, this)); this.spnTop = new Common.UI.MetricSpinner({ diff --git a/apps/documenteditor/main/app/view/Links.js b/apps/documenteditor/main/app/view/Links.js index d606f8ae2..eb641576a 100644 --- a/apps/documenteditor/main/app/view/Links.js +++ b/apps/documenteditor/main/app/view/Links.js @@ -132,6 +132,7 @@ define([ Array.prototype.push.apply(this.paragraphControls, this.btnsContents.concat(this.btnsNotes, this.btnsHyperlink)); this.btnContentsUpdate = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-contents-update'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-update', caption: this.capBtnContentsUpdate, @@ -139,25 +140,24 @@ define([ menu: true, disabled: true }); - Common.Utils.injectComponent($host.find('#slot-btn-contents-update'), this.btnContentsUpdate); this.paragraphControls.push(this.btnContentsUpdate); this.btnBookmarks = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-bookmarks'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-bookmarks', caption: this.capBtnBookmarks, disabled: true }); - Common.Utils.injectComponent($host.find('#slot-btn-bookmarks'), this.btnBookmarks); this.paragraphControls.push(this.btnBookmarks); this.btnCaption = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-caption'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-caption', caption: this.capBtnCaption, disabled: true }); - Common.Utils.injectComponent($host.find('#slot-btn-caption'), this.btnCaption); this.paragraphControls.push(this.btnCaption); this._state = {disabled: false}; diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js index 3d520ea6e..d7dc1f7a9 100644 --- a/apps/documenteditor/main/app/view/MailMergeSettings.js +++ b/apps/documenteditor/main/app/view/MailMergeSettings.js @@ -118,6 +118,7 @@ define([ _set = DE.enumLockMM; this.btnInsField = new Common.UI.Button({ + parentEl: $('#mmerge-btn-ins-field',me.$el), cls: 'btn-text-menu-default', caption: this.textInsertField, style: 'width: 100%;', @@ -128,7 +129,6 @@ define([ items: [] }) }); - this.btnInsField.render( $('#mmerge-btn-ins-field',me.$el)) ; this.txtFieldNum = new Common.UI.InputField({ el : $('#mmerge-field-num', me.$el), @@ -181,6 +181,7 @@ define([ this.emptyDBControls.push(this.chPreview); this.btnFirst = new Common.UI.Button({ + parentEl: $('#mmerge-button-first', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-firstitem', disabled: true, @@ -188,11 +189,11 @@ define([ hint: this.txtFirst, lock: [_set.noRecipients, _set.lostConnect] }); - this.btnFirst.render( $('#mmerge-button-first', me.$el)); this.btnFirst.on('click', _.bind(this.onBtnPreviewFieldClick, this)); this.emptyDBControls.push(this.btnFirst); this.btnPrev = new Common.UI.Button({ + parentEl: $('#mmerge-button-prev', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-previtem', disabled: true, @@ -200,29 +201,28 @@ define([ hint: this.txtPrev, lock: [_set.noRecipients, _set.lostConnect] }); - this.btnPrev.render( $('#mmerge-button-prev', me.$el)); this.btnPrev.on('click', _.bind(this.onBtnPreviewFieldClick, this)); this.emptyDBControls.push(this.btnPrev); this.btnNext = new Common.UI.Button({ + parentEl: $('#mmerge-button-next', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-nextitem', value: 2, hint: this.txtNext, lock: [_set.noRecipients, _set.lostConnect] }); - this.btnNext.render( $('#mmerge-button-next', me.$el)); this.btnNext.on('click', _.bind(this.onBtnPreviewFieldClick, this)); this.emptyDBControls.push(this.btnNext); this.btnLast = new Common.UI.Button({ + parentEl: $('#mmerge-button-last', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-lastitem', value: 3, hint: this.txtLast, lock: [_set.noRecipients, _set.lostConnect] }); - this.btnLast.render( $('#mmerge-button-last', me.$el)); this.btnLast.on('click', _.bind(this.onBtnPreviewFieldClick, this)); this.emptyDBControls.push(this.btnLast); diff --git a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js index e157db8cc..f53a0ec94 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ParagraphSettingsAdvanced.js @@ -401,13 +401,13 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem this._btnsBorderPosition = []; _.each(_arrBorderPresets, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[2]), style: 'margin-left: 5px; margin-bottom: 4px;', cls: 'btn-options large', iconCls: item[1], strId :item[0], hint: item[3] }); - _btn.render( $('#'+item[2])) ; _btn.on('click', _.bind(this._ApplyBorderPreset, this)); this._btnsBorderPosition.push( _btn ); }, this); diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index a376f30f0..bc5488a8f 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1396,42 +1396,42 @@ define([ this.lockedControls.push(this.cmbBorderType); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#shape-button-270', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#shape-button-270', me.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#shape-button-90', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#shape-button-90', me.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#shape-button-flipv', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#shape-button-flipv', me.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#shape-button-fliph', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#shape-button-fliph', me.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); @@ -1473,6 +1473,7 @@ define([ this.lockedControls.push(this.cmbWrapType); this.btnChangeShape = new Common.UI.Button({ + parentEl: $('#shape-btn-change'), cls: 'btn-icon-default', iconCls: 'btn-change-shape', menu : new Common.UI.Menu({ @@ -1481,7 +1482,6 @@ define([ items: [] }) }); - this.btnChangeShape.render( $('#shape-btn-change')) ; this.lockedControls.push(this.btnChangeShape); this.chShadow = new Common.UI.CheckBox({ diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index ad6354d56..788fa0ee4 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -307,12 +307,12 @@ define([ this._btnsBorderPosition = []; _.each(_arrBorderPosition, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[2]), cls: 'btn-toolbar borders--small', iconCls: item[1], strId :item[0], hint: item[3] }); - _btn.render( $('#'+item[2])) ; _btn.on('click', _.bind(this.onBtnBordersClick, this)); this._btnsBorderPosition.push( _btn ); this.lockedControls.push(_btn); @@ -328,6 +328,7 @@ define([ this.lockedControls.push(this.cmbBorderSize); this.btnEdit = new Common.UI.Button({ + parentEl: $('#table-btn-edit'), cls: 'btn-icon-default', iconCls: 'btn-edit-table', menu : new Common.UI.Menu({ @@ -352,7 +353,6 @@ define([ ] }) }); - this.btnEdit.render( $('#table-btn-edit')) ; this.mnuMerge = this.btnEdit.menu.items[this.btnEdit.menu.items.length-2]; this.mnuSplit = this.btnEdit.menu.items[this.btnEdit.menu.items.length-1]; diff --git a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js index ad16dda1d..55d042e4b 100644 --- a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js @@ -505,6 +505,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat // Wrapping this.btnWrapNone = new Common.UI.Button({ + parentEl: $('#tableadv-button-wrap-none'), cls: 'btn-options huge', iconCls: 'icon-right-panel btn-wrap-none', posId: c_tableWrap.TABLE_WRAP_NONE, @@ -513,10 +514,10 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat allowDepress: false, toggleGroup : 'advtablewrapGroup' }); - this.btnWrapNone.render( $('#tableadv-button-wrap-none')) ; this.btnWrapNone.on('click', _.bind(this.onBtnInlineWrapClick, this)); this.btnWrapParallel = new Common.UI.Button({ + parentEl: $('#tableadv-button-wrap-parallel'), cls: 'btn-options huge', iconCls: 'icon-right-panel btn-wrap-parallel', posId: c_tableWrap.TABLE_WRAP_PARALLEL, @@ -525,10 +526,10 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat allowDepress: false, toggleGroup : 'advtablewrapGroup' }); - this.btnWrapParallel.render( $('#tableadv-button-wrap-parallel')) ; this.btnWrapParallel.on('click', _.bind(this.onBtnFlowWrapClick, this)); this.btnAlignLeft = new Common.UI.Button({ + parentEl: $('#tableadv-button-align-left'), cls: 'btn-options huge', iconCls: 'icon-right-panel btn-table-align-left', posId: c_tableAlign.TABLE_ALIGN_LEFT, @@ -537,7 +538,6 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat allowDepress: false, toggleGroup : 'advtablealignGroup' }); - this.btnAlignLeft.render( $('#tableadv-button-align-left')) ; this.btnAlignLeft.on('click', _.bind(function(btn){ if (this._changedProps && btn.pressed) { this._changedProps.put_TableAlignment(btn.options.posId); @@ -548,6 +548,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat }, this)); this.btnAlignCenter = new Common.UI.Button({ + parentEl: $('#tableadv-button-align-center'), cls: 'btn-options huge', iconCls: 'icon-right-panel btn-table-align-center', posId: c_tableAlign.TABLE_ALIGN_CENTER, @@ -556,7 +557,6 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat allowDepress: false, toggleGroup : 'advtablealignGroup' }); - this.btnAlignCenter.render( $('#tableadv-button-align-center')) ; this.btnAlignCenter.on('click', _.bind(function(btn){ if (this._changedProps && btn.pressed) { this._changedProps.put_TableAlignment(btn.options.posId); @@ -567,6 +567,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat }, this)); this.btnAlignRight = new Common.UI.Button({ + parentEl: $('#tableadv-button-align-right'), cls: 'btn-options huge', iconCls: 'icon-right-panel btn-table-align-right', posId: c_tableAlign.TABLE_ALIGN_RIGHT, @@ -575,7 +576,6 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat allowDepress: false, toggleGroup : 'advtablealignGroup' }); - this.btnAlignRight.render( $('#tableadv-button-align-right')) ; this.btnAlignRight.on('click', _.bind(function(btn){ if (this._changedProps && btn.pressed) { this._changedProps.put_TableAlignment(btn.options.posId); @@ -969,13 +969,13 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this._btnsBorderPosition = []; _.each(_arrBorderPresets, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[2]), style: 'margin-left: 5px; margin-bottom: 4px;', cls: 'btn-options large', iconCls: item[1], strId :item[0], hint: item[3] }); - _btn.render( $('#'+item[2])) ; _btn.on('click', _.bind(this._ApplyBorderPreset, this)); this._btnsBorderPosition.push( _btn ); }, this); @@ -995,6 +995,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this._btnsTableBorderPosition = []; _.each(_arrTableBorderPresets, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[3]), style: 'margin-left: 5px; margin-bottom: 4px;', cls: 'btn-options large', iconCls: item[2], @@ -1002,7 +1003,6 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat strTableId :item[1], hint: item[4] }); - _btn.render( $('#'+item[3])) ; _btn.on('click', _.bind(this._ApplyBorderPreset, this)); this._btnsTableBorderPosition.push( _btn ); }, this); diff --git a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js index af9070933..4b2696422 100644 --- a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js @@ -265,39 +265,39 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', this.textControls.push(this.cmbFontSize); this.btnBold = new Common.UI.Button({ + parentEl: $('#watermark-bold'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-bold', enableToggle: true, hint: this.textBold }); - this.btnBold.render($('#watermark-bold')) ; this.textControls.push(this.btnBold); this.btnItalic = new Common.UI.Button({ + parentEl: $('#watermark-italic'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-italic', enableToggle: true, hint: this.textItalic }); - this.btnItalic.render($('#watermark-italic')) ; this.textControls.push(this.btnItalic); this.btnUnderline = new Common.UI.Button({ + parentEl: $('#watermark-underline'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-underline', enableToggle: true, hint: this.textUnderline }); - this.btnUnderline.render($('#watermark-underline')) ; this.textControls.push(this.btnUnderline); this.btnStrikeout = new Common.UI.Button({ + parentEl: $('#watermark-strikeout'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-strikeout', enableToggle: true, hint: this.textStrikeout }); - this.btnStrikeout.render($('#watermark-strikeout')) ; this.textControls.push(this.btnStrikeout); var initNewColor = function(btn, picker_el) { @@ -317,6 +317,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', return picker; }; this.btnTextColor = new Common.UI.Button({ + parentEl: $('#watermark-textcolor'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-fontcolor', hint : this.textColor, @@ -333,7 +334,6 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', ] }) }); - this.btnTextColor.render($('#watermark-textcolor')); this.mnuTextColorPicker = initNewColor(this.btnTextColor, "#watermark-menu-textcolor"); $('#watermark-auto-color').on('click', _.bind(this.onAutoColor, this)); this.textControls.push(this.btnTextColor); diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index 8bedf958a..c96fb8c13 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -258,13 +258,13 @@ define([ this.spnHeight.on('inputleave', function(){ me.fireEvent('editcomplete', me);}); this.btnRatio = new Common.UI.Button({ + parentEl: $('#chart-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#chart-button-ratio')) ; this.lockedControls.push(this.btnRatio); this.btnRatio.on('click', _.bind(function(btn, e) { diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 575079857..35fe1d82e 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -1511,11 +1511,11 @@ define([ me.cmpEl.append(pasteContainer); me.btnSpecialPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-special-paste'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-paste', menu : new Common.UI.Menu({items: []}) }); - me.btnSpecialPaste.render($('#id-document-holder-btn-special-paste')) ; } if (pasteItems.length>0) { diff --git a/apps/presentationeditor/main/app/view/ImageSettings.js b/apps/presentationeditor/main/app/view/ImageSettings.js index a5a396fde..3aecaaa8c 100644 --- a/apps/presentationeditor/main/app/view/ImageSettings.js +++ b/apps/presentationeditor/main/app/view/ImageSettings.js @@ -155,6 +155,7 @@ define([ w = this.btnOriginalSize.cmpEl.outerWidth(); this.btnCrop = new Common.UI.Button({ + parentEl: $('#image-button-crop'), cls: 'btn-text-split-default', caption: this.textCrop, split: true, @@ -182,48 +183,47 @@ define([ }] }) }); - this.btnCrop.render( $('#image-button-crop')) ; this.btnCrop.on('click', _.bind(this.onCrop, this)); this.btnCrop.menu.on('item:click', _.bind(this.onCropMenu, this)); this.lockedControls.push(this.btnCrop); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#image-button-270', this.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#image-button-270', this.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#image-button-90', this.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#image-button-90', this.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#image-button-flipv', this.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#image-button-flipv', this.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#image-button-fliph', this.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#image-button-fliph', this.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); diff --git a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js index eda93024c..fdbd5f777 100644 --- a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js @@ -140,13 +140,13 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem }, this)); this.btnRatio = new Common.UI.Button({ + parentEl: $('#image-advanced-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#image-advanced-button-ratio')) ; this.btnRatio.on('click', _.bind(function(btn, e) { if (btn.pressed && this.spnHeight.getNumberValue()>0) { this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue(); diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index c6672141e..aca7564e3 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -1308,6 +1308,7 @@ define([ this.lockedControls.push(this.cmbBorderType); this.btnChangeShape = new Common.UI.Button({ + parentEl: $('#shape-btn-change'), cls: 'btn-icon-default', iconCls: 'btn-change-shape', menu : new Common.UI.Menu({ @@ -1316,46 +1317,45 @@ define([ items: [] }) }); - this.btnChangeShape.render( $('#shape-btn-change')) ; this.lockedControls.push(this.btnChangeShape); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#shape-button-270', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#shape-button-270', me.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#shape-button-90', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#shape-button-90', me.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#shape-button-flipv', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#shape-button-flipv', me.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#shape-button-fliph', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#shape-button-fliph', me.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 9d2a4d4b1..1998152e1 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -143,13 +143,13 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem this.spinners.push(this.spnHeight); this.btnRatio = new Common.UI.Button({ + parentEl: $('#shape-advanced-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#shape-advanced-button-ratio')) ; this.btnRatio.on('click', _.bind(function(btn, e) { if (btn.pressed && this.spnHeight.getNumberValue()>0) { this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue(); diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index 80480d35c..e6b427b7f 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -230,6 +230,7 @@ define([ ); this.btnPreview = new Common.UI.Button({ + parentEl: $('#slot-status-btn-preview'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-preview', hint: this.tipPreview, @@ -245,7 +246,6 @@ define([ ] }) }); - this.btnPreview.render($('#slot-status-btn-preview')); var panelLang = $('.cnt-lang',this.el); this.langMenu = new Common.UI.MenuSimple({ diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index ed63a9367..65a3a44ff 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -295,12 +295,12 @@ define([ this._btnsBorderPosition = []; _.each(_arrBorderPosition, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[2]), cls: 'btn-toolbar borders--small', iconCls: item[1], strId :item[0], hint: item[3] }); - _btn.render( $('#'+item[2])) ; _btn.on('click', _.bind(this.onBtnBordersClick, this)); this._btnsBorderPosition.push( _btn ); this.lockedControls.push(_btn); @@ -316,6 +316,7 @@ define([ this.lockedControls.push(this.cmbBorderSize); this.btnEdit = new Common.UI.Button({ + parentEl: $('#table-btn-edit'), cls: 'btn-icon-default', iconCls: 'btn-edit-table', menu : new Common.UI.Menu({ @@ -340,7 +341,6 @@ define([ ] }) }); - this.btnEdit.render( $('#table-btn-edit')) ; this.mnuMerge = this.btnEdit.menu.items[this.btnEdit.menu.items.length-2]; this.mnuSplit = this.btnEdit.menu.items[this.btnEdit.menu.items.length-1]; diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index b21eb4cb2..b1952422d 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2308,11 +2308,11 @@ define([ documentHolderView.cmpEl.append(pasteContainer); me.btnSpecialPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-special-paste'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-paste', menu : new Common.UI.Menu({items: []}) }); - me.btnSpecialPaste.render($('#id-document-holder-btn-special-paste')) ; } if (pasteItems.length>0) { @@ -2480,11 +2480,11 @@ define([ documentHolderView.cmpEl.append(pasteContainer); me.btnAutoCorrectPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-autocorrect-paste'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-paste', menu : new Common.UI.Menu({items: []}) }); - me.btnAutoCorrectPaste.render($('#id-document-holder-btn-autocorrect-paste')) ; } if (pasteItems.length>0) { diff --git a/apps/spreadsheeteditor/main/app/view/CellEditor.js b/apps/spreadsheeteditor/main/app/view/CellEditor.js index c57fe2575..6c7024949 100644 --- a/apps/spreadsheeteditor/main/app/view/CellEditor.js +++ b/apps/spreadsheeteditor/main/app/view/CellEditor.js @@ -55,6 +55,7 @@ define([ $(this.el).html(this.template()); this.btnNamedRanges = new Common.UI.Button({ + parentEl: $('#ce-cell-name-menu'), menu : new Common.UI.Menu({ style : 'min-width: 70px;max-width:400px;', maxHeight: 250, @@ -64,7 +65,6 @@ define([ ] }) }); - this.btnNamedRanges.render($('#ce-cell-name-menu')); this.btnNamedRanges.setVisible(false); this.btnNamedRanges.menu.setOffset(-81); diff --git a/apps/spreadsheeteditor/main/app/view/CellSettings.js b/apps/spreadsheeteditor/main/app/view/CellSettings.js index c8fe0b3a9..c9ea42506 100644 --- a/apps/spreadsheeteditor/main/app/view/CellSettings.js +++ b/apps/spreadsheeteditor/main/app/view/CellSettings.js @@ -373,13 +373,13 @@ define([ _.each(_arrBorderPosition, function(item, index, list){ var _btn = new Common.UI.Button({ + parentEl: $('#'+item[2]), cls: 'btn-toolbar borders--small', iconCls: item[1], borderId:item[0], hint: item[3], disabled: this._locked }); - _btn.render( $('#'+item[2])) ; _btn.on('click', _.bind(this.onBtnBordersClick, this)); this.lockedControls.push(_btn); }, this); diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index 6e96fad09..db3d343dd 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -707,13 +707,13 @@ define([ this.spnHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); this.btnRatio = new Common.UI.Button({ + parentEl: $('#chart-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#chart-button-ratio')) ; this.lockedControls.push(this.btnRatio); this.btnRatio.on('click', _.bind(function(btn, e) { diff --git a/apps/spreadsheeteditor/main/app/view/DataTab.js b/apps/spreadsheeteditor/main/app/view/DataTab.js index 3ad81a080..bb564d929 100644 --- a/apps/spreadsheeteditor/main/app/view/DataTab.js +++ b/apps/spreadsheeteditor/main/app/view/DataTab.js @@ -115,6 +115,7 @@ define([ _set = SSE.enumLock; this.btnGroup = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-group'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-cell-group', caption: this.capBtnGroup, @@ -123,10 +124,10 @@ define([ disabled: true, lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.sheetLock, _set.lostConnect, _set.coAuth] }); - Common.Utils.injectComponent($host.find('#slot-btn-group'), this.btnGroup); this.lockedControls.push(this.btnGroup); this.btnUngroup = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-ungroup'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-cell-ungroup', caption: this.capBtnUngroup, @@ -135,10 +136,10 @@ define([ disabled: true, lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.sheetLock, _set.lostConnect, _set.coAuth] }); - Common.Utils.injectComponent($host.find('#slot-btn-ungroup'), this.btnUngroup); this.lockedControls.push(this.btnUngroup); this.btnTextToColumns = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-text-column'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-to-columns', caption: this.capBtnTextToCol, @@ -146,7 +147,6 @@ define([ disabled: true, lock: [_set.multiselect, _set.multiselectCols, _set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth] }); - Common.Utils.injectComponent($host.find('#slot-btn-text-column'), this.btnTextToColumns); this.lockedControls.push(this.btnTextToColumns); // this.btnShow = new Common.UI.Button({ @@ -170,23 +170,23 @@ define([ // this.lockedControls.push(this.btnHide); this.btnRemoveDuplicates = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-rem-duplicates'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-remove-duplicates', caption: this.capBtnTextRemDuplicates, disabled: true, lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter, _set.sheetLock] }); - Common.Utils.injectComponent($host.find('#slot-btn-rem-duplicates'), this.btnRemoveDuplicates); this.lockedControls.push(this.btnRemoveDuplicates); this.btnCustomSort = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-custom-sort'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-custom-sort', caption: this.capBtnTextCustomSort, disabled: true, lock: [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.cantModifyFilter, _set.sheetLock] }); - Common.Utils.injectComponent($host.find('#slot-btn-custom-sort'), this.btnCustomSort); this.lockedControls.push(this.btnCustomSort); this.btnsSortDown = Common.Utils.injectButtons($host.find('.slot-sortdesc'), '', 'toolbar__icon btn-sort-down', '', diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 6280bba42..ead372a55 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -472,12 +472,12 @@ define([ }); this.btnPresetsTop = new Common.UI.Button({ + parentEl: $markup.findById('#advsettings-presets-top'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 85px;', menu: true }); - this.btnPresetsTop.render( $markup.findById('#advsettings-presets-top')) ; this.txtRangeLeft = new Common.UI.InputField({ el : $markup.findById('#advsettings-txt-left'), @@ -487,12 +487,12 @@ define([ }); this.btnPresetsLeft = new Common.UI.Button({ + parentEl: $markup.findById('#advsettings-presets-left'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 85px;', menu: true }); - this.btnPresetsLeft.render( $markup.findById('#advsettings-presets-left')) ; this.btnOk = new Common.UI.Button({ el: $markup.findById('#advsettings-print-button-save') diff --git a/apps/spreadsheeteditor/main/app/view/FormulaTab.js b/apps/spreadsheeteditor/main/app/view/FormulaTab.js index 1fd6ff578..a91d45adf 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaTab.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaTab.js @@ -88,6 +88,7 @@ define([ var formulaDialog = SSE.getController('FormulaDialog'); this.btnFinancial = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-financial'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-finance', caption: formulaDialog.sCategoryFinancial, @@ -97,11 +98,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-financial'), this.btnFinancial); this.lockedControls.push(this.btnFinancial); this.formulaControls.push(this.btnFinancial); this.btnLogical = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-logical'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-logic', caption: formulaDialog.sCategoryLogical, @@ -111,11 +112,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-logical'), this.btnLogical); this.lockedControls.push(this.btnLogical); this.formulaControls.push(this.btnLogical); this.btnTextData = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-text'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-func-text', caption: formulaDialog.sCategoryTextAndData, @@ -125,11 +126,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-text'), this.btnTextData); this.lockedControls.push(this.btnTextData); this.formulaControls.push(this.btnTextData); this.btnDateTime = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-datetime'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-datetime', caption: formulaDialog.sCategoryDateAndTime, @@ -139,11 +140,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-datetime'), this.btnDateTime); this.lockedControls.push(this.btnDateTime); this.formulaControls.push(this.btnDateTime); this.btnReference = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-lookup'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-lookup', caption: formulaDialog.sCategoryLookupAndReference, @@ -153,11 +154,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-lookup'), this.btnReference); this.lockedControls.push(this.btnReference); this.formulaControls.push(this.btnReference); this.btnMath = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-math'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-func-math', caption: formulaDialog.sCategoryMathematic, @@ -167,11 +168,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-math'), this.btnMath); this.lockedControls.push(this.btnMath); this.formulaControls.push(this.btnMath); this.btnRecent = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-recent'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-recent', caption: this.txtRecent, @@ -181,11 +182,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-recent'), this.btnRecent); this.lockedControls.push(this.btnRecent); this.formulaControls.push(this.btnRecent); this.btnAutosum = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-autosum'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-autosum', caption: this.txtAutosum, @@ -207,11 +208,11 @@ define([ ] }) }); - Common.Utils.injectComponent($host.find('#slot-btn-autosum'), this.btnAutosum); this.lockedControls.push(this.btnAutosum); this.formulaControls.push(this.btnAutosum); this.btnFormula = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-additional-formula'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-ins-formula', caption: this.txtFormula, @@ -219,11 +220,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth] }); - Common.Utils.injectComponent($host.find('#slot-btn-additional-formula'), this.btnFormula); this.lockedControls.push(this.btnFormula); this.formulaControls.push(this.btnFormula); this.btnMore = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-more'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-more', caption: this.txtMore, @@ -233,11 +234,11 @@ define([ disabled: true, lock: [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.noSubitems] }); - Common.Utils.injectComponent($host.find('#slot-btn-more'), this.btnMore); this.lockedControls.push(this.btnMore); this.formulaControls.push(this.btnMore); this.btnCalculate = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-calculate'), cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-calculation', caption: this.txtCalculation, @@ -246,11 +247,11 @@ define([ disabled: true, lock: [_set.editCell, _set.selRangeEdit, _set.lostConnect, _set.coAuth] }); - Common.Utils.injectComponent($host.find('#slot-btn-calculate'), this.btnCalculate); this.lockedControls.push(this.btnCalculate); this.formulaControls.push(this.btnCalculate); this.btnNamedRange = new Common.UI.Button({ + parentEl: $host.find('#slot-btn-named-range-huge'), cls : 'btn-toolbar x-huge icon-top', iconCls : 'toolbar__icon btn-named-range', caption: this.toolbar.txtNamedRange, @@ -277,7 +278,6 @@ define([ ] }) }); - Common.Utils.injectComponent($host.find('#slot-btn-named-range-huge'), this.btnNamedRange); this.lockedControls.push(this.btnNamedRange); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js index 76b5fe51a..a407b64cd 100644 --- a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js @@ -270,20 +270,20 @@ define([ this.btnFirst.on('toggle', _.bind(this.onPageTypeToggle, this, Asc.c_oAscHeaderFooterType.first)); this.btnPresetsH = new Common.UI.Button({ + parentEl: $('#id-dlg-h-presets'), cls: 'btn-text-menu-default', caption: this.textPresets, style: 'width: 110px;', menu: true }); - this.btnPresetsH.render( $('#id-dlg-h-presets')) ; this.btnPresetsF = new Common.UI.Button({ + parentEl: $('#id-dlg-f-presets'), cls: 'btn-text-menu-default', caption: this.textPresets, style: 'width: 110px;', menu: true }); - this.btnPresetsF.render( $('#id-dlg-f-presets')) ; var data = [ {caption: this.textPageNum, value: Asc.c_oAscHeaderFooterField.pageNumber}, @@ -295,6 +295,7 @@ define([ ]; this.btnInsertH = new Common.UI.Button({ + parentEl: $('#id-dlg-h-insert'), cls: 'btn-text-menu-default', caption: this.textInsert, style: 'width: 110px;', @@ -305,11 +306,11 @@ define([ items: data }) }); - this.btnInsertH.render( $('#id-dlg-h-insert')) ; this.btnInsertH.menu.on('item:click', _.bind(this.onObjectSelect, this)); this.headerControls.push(this.btnInsertH); this.btnInsertF = new Common.UI.Button({ + parentEl: $('#id-dlg-f-insert'), cls: 'btn-text-menu-default', caption: this.textInsert, style: 'width: 110px;', @@ -320,7 +321,6 @@ define([ items: data }) }); - this.btnInsertF.render( $('#id-dlg-f-insert')) ; this.btnInsertF.menu.on('item:click', _.bind(this.onObjectSelect, this)); this.footerControls.push(this.btnInsertF); @@ -406,131 +406,131 @@ define([ this.btnBold = []; this.btnBold.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-bold'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-bold', enableToggle: true, hint: this.textBold })); - this.btnBold[0].render($('#id-dlg-h-bold')) ; this.btnBold[0].on('click', _.bind(this.onBoldClick, this)); this.headerControls.push(this.btnBold[0]); this.btnBold.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-bold'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-bold', enableToggle: true, hint: this.textBold })); - this.btnBold[1].render($('#id-dlg-f-bold')) ; this.btnBold[1].on('click', _.bind(this.onBoldClick, this)); this.footerControls.push(this.btnBold[1]); this.btnItalic = []; this.btnItalic.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-italic'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-italic', enableToggle: true, hint: this.textItalic })); - this.btnItalic[0].render($('#id-dlg-h-italic')) ; this.btnItalic[0].on('click', _.bind(this.onItalicClick, this)); this.headerControls.push(this.btnItalic[0]); this.btnItalic.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-italic'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-italic', enableToggle: true, hint: this.textItalic })); - this.btnItalic[1].render($('#id-dlg-f-italic')) ; this.btnItalic[1].on('click', _.bind(this.onItalicClick, this)); this.footerControls.push(this.btnItalic[1]); this.btnUnderline = []; this.btnUnderline.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-underline'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-underline', enableToggle: true, hint: this.textUnderline })); - this.btnUnderline[0].render($('#id-dlg-h-underline')) ; this.btnUnderline[0].on('click', _.bind(this.onUnderlineClick, this)); this.headerControls.push(this.btnUnderline[0]); this.btnUnderline.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-underline'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-underline', enableToggle: true, hint: this.textUnderline })); - this.btnUnderline[1].render($('#id-dlg-f-underline')) ; this.btnUnderline[1].on('click', _.bind(this.onUnderlineClick, this)); this.footerControls.push(this.btnUnderline[1]); this.btnStrikeout = []; this.btnStrikeout.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-strikeout'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-strikeout', enableToggle: true, hint: this.textStrikeout })); - this.btnStrikeout[0].render($('#id-dlg-h-strikeout')) ; this.btnStrikeout[0].on('click',_.bind(this.onStrikeoutClick, this)); this.headerControls.push(this.btnStrikeout[0]); this.btnStrikeout.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-strikeout'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-strikeout', enableToggle: true, hint: this.textStrikeout })); - this.btnStrikeout[1].render($('#id-dlg-f-strikeout')) ; this.btnStrikeout[1].on('click',_.bind(this.onStrikeoutClick, this)); this.footerControls.push(this.btnStrikeout[1]); this.btnSuperscript = []; this.btnSuperscript.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-superscript'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-superscript', enableToggle: true, toggleGroup: 'superscriptHFGroup', hint: this.textSuperscript })); - this.btnSuperscript[0].render($('#id-dlg-h-superscript')) ; this.btnSuperscript[0].on('click', _.bind(this.onSuperscriptClick, this)); this.headerControls.push(this.btnSuperscript[0]); this.btnSuperscript.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-superscript'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-superscript', enableToggle: true, toggleGroup: 'superscriptHFGroup', hint: this.textSuperscript })); - this.btnSuperscript[1].render($('#id-dlg-f-superscript')) ; this.btnSuperscript[1].on('click', _.bind(this.onSuperscriptClick, this)); this.footerControls.push(this.btnSuperscript[1]); this.btnSubscript = []; this.btnSubscript.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-subscript'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-subscript', enableToggle: true, toggleGroup: 'superscriptHFGroup', hint: this.textSubscript })); - this.btnSubscript[0].render($('#id-dlg-h-subscript')) ; this.btnSubscript[0].on('click', _.bind(this.onSubscriptClick, this)); this.headerControls.push(this.btnSubscript[0]); this.btnSubscript.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-subscript'), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-subscript', enableToggle: true, toggleGroup: 'superscriptHFGroup', hint: this.textSubscript })); - this.btnSubscript[1].render($('#id-dlg-f-subscript')) ; this.btnSubscript[1].on('click', _.bind(this.onSubscriptClick, this)); this.footerControls.push(this.btnSubscript[1]); @@ -553,6 +553,7 @@ define([ }; this.btnTextColor = []; this.btnTextColor.push(new Common.UI.Button({ + parentEl: $('#id-dlg-h-textcolor'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-fontcolor', hint : this.textColor, @@ -565,13 +566,13 @@ define([ ] }) })); - this.btnTextColor[0].render($('#id-dlg-h-textcolor')); this.btnTextColor[0].on('click', _.bind(this.onTextColor, this)); this.mnuTextColorPicker = []; this.mnuTextColorPicker.push(initNewColor(this.btnTextColor[0], "#id-dlg-h-menu-fontcolor")); this.headerControls.push(this.btnTextColor[0]); this.btnTextColor.push(new Common.UI.Button({ + parentEl: $('#id-dlg-f-textcolor'), cls : 'btn-toolbar', iconCls : 'toolbar__icon btn-fontcolor', hint : this.textColor, @@ -584,7 +585,6 @@ define([ ] }) })); - this.btnTextColor[1].render($('#id-dlg-f-textcolor')); this.btnTextColor[1].on('click', _.bind(this.onTextColor, this)); this.mnuTextColorPicker.push(initNewColor(this.btnTextColor[1], "#id-dlg-f-menu-fontcolor")); this.footerControls.push(this.btnTextColor[1]); diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettings.js b/apps/spreadsheeteditor/main/app/view/ImageSettings.js index e0d6d93fb..8769ba08f 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettings.js @@ -141,13 +141,13 @@ define([ this.lockedControls.push(this.spnHeight); this.btnRatio = new Common.UI.Button({ + parentEl: $('#image-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#image-button-ratio')) ; this.lockedControls.push(this.btnRatio); this.btnRatio.on('click', _.bind(function(btn, e) { @@ -203,6 +203,7 @@ define([ var w = this.btnOriginalSize.cmpEl.outerWidth(); this.btnCrop = new Common.UI.Button({ + parentEl: $('#image-button-crop'), cls: 'btn-text-split-default', caption: this.textCrop, split: true, @@ -230,48 +231,47 @@ define([ }] }) }); - this.btnCrop.render( $('#image-button-crop')) ; this.btnCrop.on('click', _.bind(this.onCrop, this)); this.btnCrop.menu.on('item:click', _.bind(this.onCropMenu, this)); this.lockedControls.push(this.btnCrop); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#image-button-270', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#image-button-270', me.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#image-button-90', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#image-button-90', me.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#image-button-flipv', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#image-button-flipv', me.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#image-button-fliph', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#image-button-fliph', me.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); diff --git a/apps/spreadsheeteditor/main/app/view/PrintSettings.js b/apps/spreadsheeteditor/main/app/view/PrintSettings.js index 9d3568cdb..a78b35c08 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PrintSettings.js @@ -237,12 +237,12 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', }); this.btnPresetsTop = new Common.UI.Button({ + parentEl: $('#printadv-dlg-presets-top'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 85px;', menu: true }); - this.btnPresetsTop.render( $('#printadv-dlg-presets-top')) ; this.txtRangeLeft = new Common.UI.InputFieldBtn({ el : $('#printadv-dlg-txt-left'), @@ -252,12 +252,12 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', }); this.btnPresetsLeft = new Common.UI.Button({ + parentEl: $('#printadv-dlg-presets-left'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 85px;', menu: true }); - this.btnPresetsLeft.render( $('#printadv-dlg-presets-left')) ; this.btnHide = new Common.UI.Button({ el: $('#printadv-dlg-btn-hide') diff --git a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js index eec28f2da..ab7efd41e 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js @@ -122,6 +122,7 @@ define([ var frozen = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.frozen, false, this.sheet); this.btnPresetsTop = new Common.UI.Button({ + parentEl: $('#print-titles-presets-top'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 95px;', @@ -138,7 +139,6 @@ define([ ] }) }); - this.btnPresetsTop.render( $('#print-titles-presets-top')) ; this.btnPresetsTop.menu.on('item:click', _.bind(this.onPresetSelect, this, 'top')); this.txtRangeTop.on('button:click', _.bind(this.onPresetSelect, this, 'top', this.btnPresetsTop.menu, {value: 'select'})); @@ -159,6 +159,7 @@ define([ frozen = this.api.asc_getPrintTitlesRange(Asc.c_oAscPrintTitlesRangeType.frozen, true, this.sheet); this.btnPresetsLeft = new Common.UI.Button({ + parentEl: $('#print-titles-presets-left'), cls: 'btn-text-menu-default', caption: this.textRepeat, style: 'width: 95px;', @@ -175,7 +176,6 @@ define([ ] }) }); - this.btnPresetsLeft.render( $('#print-titles-presets-left')) ; this.btnPresetsLeft.menu.on('item:click', _.bind(this.onPresetSelect, this, 'left')); this.txtRangeLeft.on('button:click', _.bind(this.onPresetSelect, this, 'left', this.btnPresetsLeft.menu, {value: 'select'})); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 10906ffd9..179293992 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -1332,6 +1332,7 @@ define([ this.lockedControls.push(this.cmbBorderType); this.btnChangeShape = new Common.UI.Button({ + parentEl: $('#shape-btn-change'), cls: 'btn-icon-default', iconCls: 'btn-change-shape', menu : new Common.UI.Menu({ @@ -1340,46 +1341,45 @@ define([ items: [] }) }); - this.btnChangeShape.render( $('#shape-btn-change')) ; this.lockedControls.push(this.btnChangeShape); this.btnRotate270 = new Common.UI.Button({ + parentEl: $('#shape-button-270', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-270', value: 0, hint: this.textHint270 }); - this.btnRotate270.render( $('#shape-button-270', me.$el)); this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate270); this.btnRotate90 = new Common.UI.Button({ + parentEl: $('#shape-button-90', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-rotate-90', value: 1, hint: this.textHint90 }); - this.btnRotate90.render( $('#shape-button-90', me.$el)); this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); this.lockedControls.push(this.btnRotate90); this.btnFlipV = new Common.UI.Button({ + parentEl: $('#shape-button-flipv', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-vert', value: 0, hint: this.textHintFlipV }); - this.btnFlipV.render( $('#shape-button-flipv', me.$el)); this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipV); this.btnFlipH = new Common.UI.Button({ + parentEl: $('#shape-button-fliph', me.$el), cls: 'btn-toolbar', iconCls: 'toolbar__icon btn-flip-hor', value: 1, hint: this.textHintFlipH }); - this.btnFlipH.render( $('#shape-button-fliph', me.$el)); this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); this.lockedControls.push(this.btnFlipH); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index a25e2f04c..f08fe7688 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -144,13 +144,13 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp this.spinners.push(this.spnHeight); this.btnRatio = new Common.UI.Button({ + parentEl: $('#shape-advanced-button-ratio'), cls: 'btn-toolbar', iconCls: 'toolbar__icon advanced-btn-ratio', style: 'margin-bottom: 1px;', enableToggle: true, hint: this.textKeepRatio }); - this.btnRatio.render($('#shape-advanced-button-ratio')) ; this.btnRatio.on('click', _.bind(function(btn, e) { if (btn.pressed && this.spnHeight.getNumberValue()>0) { this._nRatio = this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue(); diff --git a/apps/spreadsheeteditor/main/app/view/SortDialog.js b/apps/spreadsheeteditor/main/app/view/SortDialog.js index 143dc7a6d..06d29a3ae 100644 --- a/apps/spreadsheeteditor/main/app/view/SortDialog.js +++ b/apps/spreadsheeteditor/main/app/view/SortDialog.js @@ -176,19 +176,19 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template', this.btnOptions.on('click', _.bind(this.onOptions, this, false)); this.btnUp = new Common.UI.Button({ + parentEl: $('#sort-dialog-btn-up'), cls: 'btn-toolbar', iconCls: 'caret-up', hint: this.textUp }); - this.btnUp.render($('#sort-dialog-btn-up')) ; this.btnUp.on('click', _.bind(this.onMoveClick, this, true)); this.btnDown = new Common.UI.Button({ + parentEl: $('#sort-dialog-btn-down'), cls: 'btn-toolbar', iconCls: 'caret-down', hint: this.textDown }); - this.btnDown.render($('#sort-dialog-btn-down')) ; this.btnDown.on('click', _.bind(this.onMoveClick, this, false)); this.lblColumn = $('#sort-dialog-label-column'); diff --git a/apps/spreadsheeteditor/main/app/view/Spellcheck.js b/apps/spreadsheeteditor/main/app/view/Spellcheck.js index c9501c81c..16eb9d8c5 100644 --- a/apps/spreadsheeteditor/main/app/view/Spellcheck.js +++ b/apps/spreadsheeteditor/main/app/view/Spellcheck.js @@ -80,12 +80,12 @@ define([ }); this.buttonNext = new Common.UI.Button({ + parentEl: $('#spellcheck-next'), style: 'margin-left: 5px; width: 22px; height: 22px; border: 1px solid #cfcfcf;', cls: 'btn-toolbar bg-white', iconCls: 'toolbar__icon btn-nextitem', hint: this.txtNextTip }); - this.buttonNext.render($('#spellcheck-next')); this.suggestionList = new Common.UI.ListView({ el: $('#spellcheck-suggestions-list'), @@ -95,6 +95,7 @@ define([ }); this.btnChange = new Common.UI.Button({ + parentEl: $('#spellcheck-change'), cls: 'btn-text-split-default', caption: this.textChange, split: true, @@ -114,9 +115,9 @@ define([ ] }) }); - this.btnChange.render( $('#spellcheck-change')) ; this.btnIgnore = new Common.UI.Button({ + parentEl: $('#spellcheck-ignore'), cls: 'btn-text-split-default', caption: this.textIgnore, split: true, @@ -136,7 +137,6 @@ define([ ] }) }); - this.btnIgnore.render( $('#spellcheck-ignore')) ; this.cmbDictionaryLanguage = new Common.UI.ComboBox({ el : $('#spellcheck-dictionary-language'), diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index 542ba3565..7f0d3c48c 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -251,6 +251,7 @@ define([ this.lockedControls.push(this.btnSelectData); this.btnEdit = new Common.UI.Button({ + parentEl: $('#table-btn-edit'), cls: 'btn-icon-default', iconCls: 'btn-edit-table', menu : new Common.UI.Menu({ @@ -272,7 +273,6 @@ define([ ] }) }); - this.btnEdit.render( $('#table-btn-edit')) ; this.btnEdit.menu.on('show:after', _.bind( function(menu){ if (this.api) { menu.items[5].setDisabled(!this._originalProps.asc_getIsInsertRowAbove());