diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index b5ef5a8d0c..6e9e0160dd 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -871,6 +871,7 @@ define([ this.submitedTooltip && this.submitedTooltip.hide(); this.view.btnSubmit.setDisabled(true); this.view.btnSubmit.cmpEl.css("pointer-events", "none"); + this.disableFillingForms(true); break; case LoadingDocument: text = this.textLoadingDocument + ' '; @@ -923,7 +924,8 @@ define([ this.submitedTooltip.show(); this.api.asc_setRestriction(Asc.c_oAscRestrictionType.View); this.onApiServerDisconnect(true); - } + } else + this.disableFillingForms(false); } if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['LoadFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges'] || id == Asc.c_oAscAsyncAction['DownloadAs']) && Common.Utils.ModalWindow.isVisible()) ) { @@ -1974,6 +1976,14 @@ define([ } }, + disableFillingForms: function(state) { + this._isDisabled = state; + this.view && this.view.btnClear && this.view.btnClear.setDisabled(state); + this.view && this.view.btnUndo && this.view.btnUndo.setDisabled(state || !this.api.asc_getCanUndo()); + this.view && this.view.btnRedo && this.view.btnRedo.setDisabled(state || !this.api.asc_getCanRedo()); + this.api.asc_setRestriction(state || !this.appOptions.canFillForms ? Asc.c_oAscRestrictionType.View : Asc.c_oAscRestrictionType.OnlyForms); + }, + onApiServerDisconnect: function(enableDownload) { this._state.isDisconnected = true; this._isDisabled = true; diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index e54e85a21e..58e3a43741 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -457,6 +457,7 @@ define([ onLongActionBegin: function(type, id) { if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) { + Common.NotificationCenter.trigger('doc:mode-apply', 'view', true, true); this._submitFail = false; this.submitedTooltip && this.submitedTooltip.hide(); Common.Utils.lockControls(Common.enumLock.submit, true, {array: [this.view.btnSubmit]}) @@ -482,8 +483,8 @@ define([ }, this); } this.submitedTooltip.show(); - Common.NotificationCenter.trigger('doc:mode-apply', 'view', true, true); - } + } else + Common.NotificationCenter.trigger('doc:mode-apply', 'view-form', true, true); } }, diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index a21ea38a37..ce25fa056c 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1974,7 +1974,7 @@ define([ '
rgba(0,0,0,0.4)<%} else {%>var(--text-tertiary)<%}%> <%= offsetX %>px <%= offsetY %>px 0px <%= spread %>px ;"' + '>' + '
' + '') diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index 499b41d8d4..bbbb8cfd2e 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -314,11 +314,15 @@ visible = true; isForm && document.body.classList.add('pdf-form'); - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -327,12 +331,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '592px'; else diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy index 5346153c64..940b2a21de 100644 --- a/apps/documenteditor/main/index.html.deploy +++ b/apps/documenteditor/main/index.html.deploy @@ -277,11 +277,15 @@ visible = true; isForm && document.body.classList.add('pdf-form'); - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -290,12 +294,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '592px'; else diff --git a/apps/pdfeditor/main/app/controller/DocumentHolder.js b/apps/pdfeditor/main/app/controller/DocumentHolder.js index 15cf19fd9e..ee1da2500a 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolder.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolder.js @@ -81,7 +81,10 @@ define([ 'DocumentHolder': { 'createdelayedelements': this.createDelayedElements, 'equation:callback': this.equationCallback - } + }, + 'FileMenu': { + 'settings:apply': _.bind(this.applySettings, this) + }, }); var me = this; @@ -2811,7 +2814,7 @@ define([ } this.lastAnnotBarBounds = bounds; - if (bounds[3] < 0 || bounds[1] > this._Height) { + if (bounds[3] < 0 || bounds[1] > this._Height || !Common.Utils.InternalSettings.get('pdfe-settings-annot-bar')) { this.onHideAnnotBar(); return; } @@ -2901,6 +2904,10 @@ define([ editComplete: function() { this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder); + }, + + applySettings: function() { + !Common.Utils.InternalSettings.get('pdfe-settings-annot-bar') && this.onHideAnnotBar(); } }); }); \ No newline at end of file diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 7b3be5fa30..d0666afad9 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -1015,6 +1015,8 @@ define([ value = Common.localStorage.getBool("pdfe-settings-show-alt-hints", Common.Utils.isMac ? false : true); Common.Utils.InternalSettings.set("pdfe-settings-show-alt-hints", value); + value = Common.localStorage.getBool("pdfe-settings-annot-bar", true); + Common.Utils.InternalSettings.set("pdfe-settings-annot-bar", value); /** coauthoring begin **/ me.onPdfModeCoAuthApply(); diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index 759cc967c6..cf86eb3d6a 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -1306,7 +1306,7 @@ define([ (new Promise(function(accept) { accept(); })).then(function () { - var hand = (config.isEdit && !config.isPDFEdit || config.isRestrictedEdit); + var hand = !config.isEdit; me.toolbar && me.toolbar.btnHandTool && me.toolbar[hand ? 'btnHandTool' : 'btnSelectTool'].toggle(true, true); me.api && me.api.asc_setViewerTargetType(hand ? 'hand' : 'select'); if (config.isRestrictedEdit && me.toolbar && me.toolbar.btnSubmit && me.api && !me.api.asc_IsAllRequiredFormsFilled()) { diff --git a/apps/pdfeditor/main/app/view/FileMenuPanels.js b/apps/pdfeditor/main/app/view/FileMenuPanels.js index 0b1126580f..5be5df1a5c 100644 --- a/apps/pdfeditor/main/app/view/FileMenuPanels.js +++ b/apps/pdfeditor/main/app/view/FileMenuPanels.js @@ -40,7 +40,8 @@ */ define([ - 'common/main/lib/view/DocumentAccessDialog' + 'common/main/lib/view/DocumentAccessDialog', + 'common/main/lib/view/CustomizeQuickAccessDialog' ], function () { 'use strict'; @@ -346,6 +347,9 @@ define([ '', '
', '', + '', + '
', + '', '', '
Beta', '', @@ -355,13 +359,16 @@ define([ '', '', '',*/ + '', + '', + '', '', '', '', '
', '
', '', - '', + '', '', '', '', @@ -410,6 +417,14 @@ define([ }); (Common.Utils.isIE || Common.Utils.isMac && Common.Utils.isGecko) && this.chUseAltKey.$el.parent().parent().hide(); + this.chUseAnnotateBar = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-annotation-bar'), + labelText: this.txtUseAnnotateBar, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.chScreenReader = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-scrn-reader'), labelText: this.txtScreenReader, @@ -590,6 +605,11 @@ define([ dataHintOffset: 'big' }); + this.btnCustomizeQuickAccess = new Common.UI.Button({ + el: $markup.findById('#fms-btn-customize-quick-access') + }); + this.btnCustomizeQuickAccess.on('click', _.bind(this.customizeQuickAccess, this)); + this.cmbTheme = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-theme'), style : 'width: 160px;', @@ -690,7 +710,8 @@ define([ var fast_coauth = Common.Utils.InternalSettings.get("pdfe-settings-coauthmode"), canPDFSave = (mode.isPDFAnnotate || mode.isPDFEdit) && mode.canSaveToFile && !mode.isOffline; - $('tr.edit', this.el)[mode.isPDFEdit?'show':'hide'](); + $('tr.edit', this.el)[mode.isEdit?'show':'hide'](); + $('tr.edit-pdf', this.el)[mode.isPDFEdit?'show':'hide'](); $('tr.autosave', this.el)[mode.isEdit && canPDFSave && (mode.canChangeCoAuthoring || !fast_coauth) ? 'show' : 'hide'](); $('tr.forcesave', this.el)[mode.canForcesave && canPDFSave ? 'show' : 'hide'](); $('tr.editsave',this.el)[(mode.isEdit || mode.canForcesave) && canPDFSave ? 'show' : 'hide'](); @@ -709,6 +730,10 @@ define([ if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); } + + if (mode.compactHeader) { + $('tr.quick-access', this.el).hide(); + } }, setApi: function(o) { @@ -719,6 +744,7 @@ define([ updateSettings: function() { this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("pdfe-settings-show-alt-hints")); this.chScreenReader.setValue(Common.Utils.InternalSettings.get("app-settings-screen-reader")); + this.chUseAnnotateBar.setValue(Common.Utils.InternalSettings.get("pdfe-settings-annot-bar")); var value = Common.Utils.InternalSettings.get("pdfe-settings-zoom"); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); @@ -788,6 +814,8 @@ define([ Common.localStorage.setItem("pdfe-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("pdfe-settings-zoom", Common.localStorage.getItem("pdfe-settings-zoom")); Common.localStorage.setItem("app-settings-screen-reader", this.chScreenReader.isChecked() ? 1 : 0); + Common.localStorage.setItem("pdfe-settings-annot-bar", this.chUseAnnotateBar.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("pdfe-settings-annot-bar", Common.localStorage.getBool("pdfe-settings-annot-bar")); /** coauthoring begin **/ Common.Utils.InternalSettings.set("pdfe-settings-livecomment", this.chLiveComment.isChecked()); @@ -854,6 +882,23 @@ define([ this._fontRender = combo.getValue(); }, + customizeQuickAccess: function () { + if (this.dlgQuickAccess && this.dlgQuickAccess.isVisible()) return; + this.dlgQuickAccess = new Common.Views.CustomizeQuickAccessDialog({ + showSave: this.mode.showSaveButton, + showPrint: this.mode.canPrint && this.mode.twoLevelHeader, + showQuickPrint: this.mode.canQuickPrint && this.mode.twoLevelHeader, + props: { + save: Common.localStorage.getBool('pdfe-quick-access-save', true), + print: Common.localStorage.getBool('pdfe-quick-access-print', true), + quickPrint: Common.localStorage.getBool('pdfe-quick-access-quick-print', true), + undo: Common.localStorage.getBool('pdfe-quick-access-undo', true), + redo: Common.localStorage.getBool('pdfe-quick-access-redo', true) + } + }); + this.dlgQuickAccess.show(); + }, + strZoom: 'Default Zoom Value', strShowChanges: 'Real-time Collaboration Changes', txtAll: 'View All', @@ -897,7 +942,9 @@ define([ strUnit: 'Unit of Measurement', txtInch: 'Inch', txtCm: 'Centimeter', - txtPt: 'Point' + txtPt: 'Point', + txtUseAnnotateBar: 'Use the mini toolbar when selecting text', + txtCustomizeQuickAccess: 'Customize quick access' }, PDFE.Views.FileMenuPanels.Settings || {})); diff --git a/apps/pdfeditor/main/app/view/ShapeSettings.js b/apps/pdfeditor/main/app/view/ShapeSettings.js index 01ea8c6842..61d97e6cd3 100644 --- a/apps/pdfeditor/main/app/view/ShapeSettings.js +++ b/apps/pdfeditor/main/app/view/ShapeSettings.js @@ -1835,7 +1835,7 @@ define([ '
rgba(0,0,0,0.4)<%} else {%>var(--text-tertiary)<%}%> <%= offsetX %>px <%= offsetY %>px 0px <%= spread %>px ;"' + '>' + '
' + '') diff --git a/apps/pdfeditor/main/index.html b/apps/pdfeditor/main/index.html index 656107b93d..6ccf162770 100644 --- a/apps/pdfeditor/main/index.html +++ b/apps/pdfeditor/main/index.html @@ -298,11 +298,15 @@ view = params["mode"] == 'view', visible = true; - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -311,12 +315,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } } visible && (document.querySelector('.brendpanel').style.display = 'block'); diff --git a/apps/pdfeditor/main/index.html.deploy b/apps/pdfeditor/main/index.html.deploy index dee54784b7..70811d9632 100644 --- a/apps/pdfeditor/main/index.html.deploy +++ b/apps/pdfeditor/main/index.html.deploy @@ -262,11 +262,15 @@ view = params["mode"] == 'view', visible = true; - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -275,12 +279,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } } visible && (document.querySelector('.brendpanel').style.display = 'block'); diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index b105ebc694..e7bc42661a 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -330,6 +330,13 @@ "Common.Views.UserNameDialog.textDontShow": "Don't ask me again", "Common.Views.UserNameDialog.textLabel": "Label:", "Common.Views.UserNameDialog.textLabelError": "Label must not be empty.", + "Common.Views.CustomizeQuickAccessDialog.textMsg": "Check the commands that will be displayed on the Quick Access Toolbar", + "Common.Views.CustomizeQuickAccessDialog.textPrint": "Print", + "Common.Views.CustomizeQuickAccessDialog.textQuickPrint": "Quick Print", + "Common.Views.CustomizeQuickAccessDialog.textRedo": "Redo", + "Common.Views.CustomizeQuickAccessDialog.textSave": "Save", + "Common.Views.CustomizeQuickAccessDialog.textTitle": "Customize quick access", + "Common.Views.CustomizeQuickAccessDialog.textUndo": "Undo", "PDFE.Controllers.InsTab.textAccent": "Accents", "PDFE.Controllers.InsTab.textBracket": "Brackets", "PDFE.Controllers.InsTab.textFraction": "Fractions", @@ -1322,6 +1329,8 @@ "PDFE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "PDFE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "PDFE.Views.FileMenuPanels.Settings.txtWorkspace": "Workspace", + "PDFE.Views.FileMenuPanels.Settings.txtUseAnnotateBar": "Use the mini toolbar when selecting text", + "PDFE.Views.FileMenuPanels.txtCustomizeQuickAccess": "Customize quick access", "PDFE.Views.FileMenuPanels.ViewSaveAs.textDownloadAs": "Download as", "PDFE.Views.FileMenuPanels.ViewSaveCopy.textSaveCopyAs": "Save Copy as", "PDFE.Views.HyperlinkSettingsDialog.strDisplay": "Display", diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index 56971a1386..acd595304a 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -1835,7 +1835,7 @@ define([ '
rgba(0,0,0,0.4)<%} else {%>var(--text-tertiary)<%}%> <%= offsetX %>px <%= offsetY %>px 0px <%= spread %>px ;"' + '>' + '
' + '') diff --git a/apps/presentationeditor/main/index.html b/apps/presentationeditor/main/index.html index ddf2dcc0c4..2e2547fc7f 100644 --- a/apps/presentationeditor/main/index.html +++ b/apps/presentationeditor/main/index.html @@ -311,11 +311,15 @@ view = params["mode"] == 'view', visible = true; - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -324,12 +328,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '865px'; else diff --git a/apps/presentationeditor/main/index.html.deploy b/apps/presentationeditor/main/index.html.deploy index 46fa96a28a..5936f45bf0 100644 --- a/apps/presentationeditor/main/index.html.deploy +++ b/apps/presentationeditor/main/index.html.deploy @@ -304,11 +304,15 @@ view = params["mode"] == 'view', visible = true; - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -317,12 +321,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '865px'; else diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index afe1d0617c..403343723f 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -1851,7 +1851,7 @@ define([ '
rgba(0,0,0,0.4)<%} else {%>var(--text-tertiary)<%}%> <%= offsetX %>px <%= offsetY %>px 0px <%= spread %>px ;"' + '>' + '
' + '') diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html index 1167ddb7b3..c4e5888ca9 100644 --- a/apps/spreadsheeteditor/main/index.html +++ b/apps/spreadsheeteditor/main/index.html @@ -330,15 +330,21 @@ visible = true; if (internal) { - document.querySelector('.brendpanel').remove(); - document.querySelector('.sktoolbar').remove(); + let child = document.querySelector('.brendpanel'); + child && child.parentNode && child.parentNode.removeChild(child); + child = document.querySelector('.sktoolbar'); + child && child.parentNode && child.parentNode.removeChild(child); } - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -347,12 +353,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '923px'; else diff --git a/apps/spreadsheeteditor/main/index.html.deploy b/apps/spreadsheeteditor/main/index.html.deploy index 73b2798757..0dbbd26513 100644 --- a/apps/spreadsheeteditor/main/index.html.deploy +++ b/apps/spreadsheeteditor/main/index.html.deploy @@ -316,15 +316,21 @@ visible = true; if (internal) { - document.querySelector('.brendpanel').remove(); - document.querySelector('.sktoolbar').remove(); + let child = document.querySelector('.brendpanel'); + child && child.parentNode && child.parentNode.removeChild(child); + child = document.querySelector('.sktoolbar'); + child && child.parentNode && child.parentNode.removeChild(child); } - (compact || view || notoolbar) && document.querySelector('.brendpanel > :nth-child(2)').remove(); + if (compact || view || notoolbar) { + let child = document.querySelector('.brendpanel > :nth-child(2)'); + child && child.parentNode && child.parentNode.removeChild(child); + } if (compact || view) { if (notoolbar) { - document.querySelector('.brendpanel > :nth-child(1)').remove(); + let child = document.querySelector('.brendpanel > :nth-child(1)'); + child && child.parentNode && child.parentNode.removeChild(child); visible = false; } else document.querySelector('.brendpanel > :nth-child(1)').style.height = '32px'; @@ -333,12 +339,14 @@ } if (compact) { - document.querySelectorAll('.not-compact').forEach(function(item){ - item.remove(); - }); - document.querySelectorAll('.compact').forEach(function(item){ - item.style.display = 'inline-block'; - }); + var elements = document.querySelectorAll('.not-compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].parentNode.removeChild(elements[i]); + } + elements = document.querySelectorAll('.compact'); + for (let i = 0; i < elements.length; i++) { + elements[i].style.display = 'inline-block'; + } if (document.body.classList.contains('rtl')) document.querySelector('.fat').style.right = '923px'; else