From 1b2b5ff36ab55d0b204a9b858010467a06a439f1 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 3 Sep 2020 18:43:03 +0300 Subject: [PATCH] Update bootstrap (dropdown menu) --- apps/common/main/lib/component/Button.js | 10 ++++----- apps/common/main/lib/component/ColorButton.js | 2 +- apps/common/main/lib/component/ComboBox.js | 10 ++++----- .../main/lib/component/ComboBoxFonts.js | 12 +++++------ .../main/lib/component/ComboDataView.js | 2 +- apps/common/main/lib/component/InputField.js | 12 +++++------ apps/common/main/lib/component/Menu.js | 11 +++++----- apps/common/main/lib/component/MenuItem.js | 5 +++-- apps/common/main/lib/component/Tooltip.js | 2 +- apps/common/main/lib/extend/Bootstrap.js | 10 ++++----- apps/common/main/lib/view/Comments.js | 4 ++-- apps/common/main/lib/view/History.js | 2 +- apps/common/main/lib/view/ReviewPopover.js | 2 +- apps/common/main/resources/less/combobox.less | 2 +- .../embed/js/ApplicationController.js | 2 +- .../main/app/controller/Viewport.js | 3 ++- .../main/app/view/ListSettingsDialog.js | 4 ++-- apps/documenteditor/main/app/view/Toolbar.js | 21 ++++++++++--------- .../main/resources/less/filemenu.less | 4 ++-- .../embed/js/ApplicationController.js | 2 +- .../main/resources/less/leftmenu.less | 6 +++--- .../embed/js/ApplicationController.js | 2 +- .../main/app/view/FormulaTab.js | 2 +- .../main/app/view/NameManagerDlg.js | 2 +- .../main/app/view/Toolbar.js | 2 +- .../main/resources/less/leftmenu.less | 6 +++--- 26 files changed, 73 insertions(+), 69 deletions(-) diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index 29fc096d6..f8b11c628 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -223,7 +223,7 @@ define([ templateBtnIcon + '' + '' + - '', - '', @@ -388,7 +388,7 @@ define([ if (modalParents.length > 0) { $(me.btnEl.data('bs.tooltip').getTipElement()).css('z-index', parseInt(modalParents.css('z-index')) + 10); - me.btnMenuEl && me.btnMenuEl.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); + me.btnMenuEl && $(me.btnMenuEl.data('bs.tooltip').getTipElement()).css('z-index', parseInt(modalParents.css('z-index')) + 10); var onModalClose = function(dlg) { if (modalParents[0] !== dlg.$window[0]) return; var tip = me.btnEl.data('bs.tooltip'); @@ -719,8 +719,8 @@ define([ }); if (modalParents.length > 0) { - this.btnEl.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); - this.btnMenuEl && this.btnMenuEl.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); + $(this.btnEl.data('bs.tooltip').getTipElement()).css('z-index', parseInt(modalParents.css('z-index')) + 10); + this.btnMenuEl && $(this.btnMenuEl.data('bs.tooltip').getTipElement()).css('z-index', parseInt(modalParents.css('z-index')) + 10); } if (this.disabled || !Common.Utils.isGecko) { diff --git a/apps/common/main/lib/component/ColorButton.js b/apps/common/main/lib/component/ColorButton.js index c01bcd325..eddb4ac26 100644 --- a/apps/common/main/lib/component/ColorButton.js +++ b/apps/common/main/lib/component/ColorButton.js @@ -109,7 +109,7 @@ define([ id: id, additionalAlign: options.additionalAlign, items: (options.additionalItems ? options.additionalItems : []).concat([ - { template: _.template('
') }, + { template: _.template('
'), clsDropdownItem: false }, { template: _.template('' + this.textNewColor + '') } ]) }); diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 78a7b0a22..383324cad 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -43,7 +43,7 @@ * *
* - * + * * *
* @@ -92,10 +92,10 @@ define([ template: _.template([ '', '', - '', + '', '', '' @@ -192,7 +192,7 @@ define([ var modalParents = el.closest('.asc-window'); if (modalParents.length > 0) { - el.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10); + $(el.data('bs.tooltip').getTipElement()).css('z-index', parseInt(modalParents.css('z-index')) + 10); var onModalClose = function(dlg) { if (modalParents[0] !== dlg.$window[0]) return; var tip = el.data('bs.tooltip'); @@ -644,7 +644,7 @@ define([ } else { $(this.el).find('ul').html(_.template([ '<% _.each(items, function(item) { %>', - '
  • <%= scope.getDisplayValue(item) %>
  • ', + '', '<% }); %>' ].join(''))({ items: this.store.toJSON(), diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index a109a10e7..668bb1639 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -71,11 +71,11 @@ define([ '
    ', ' ', '
    ', - '', + '', '
    ' ].join('')), stopPropagation: true, - value: me.header.mnuZoom.options.value + value: me.header.mnuZoom.options.value, + clsDropdownItem: false }); me.header.btnOptions.setMenu(new Common.UI.Menu({ diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index ff07be93b..dbfe8329b 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -184,7 +184,7 @@ define([ var itemsTemplate = [ '<% _.each(items, function(item) { %>', - '
  • ', + '
  • ', '<% }); %>' @@ -193,7 +193,7 @@ define([ '
    ', '
    ', '
    ', - '', + '', '', '
    ' diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 029e27b84..3445adc44 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -242,7 +242,7 @@ define([ menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ - {template: _.template('
    ')}, + {template: _.template('
    '), clsDropdownItem: false}, {caption: '--'}, this.mnuHighlightTransparent = new Common.UI.MenuItem({ caption: this.strMenuNoFill, @@ -267,7 +267,7 @@ define([ template: _.template('<%= caption %>') }, {caption: '--'}, - {template: _.template('
    ')}, + {template: _.template('
    '), clsDropdownItem: false}, {template: _.template('' + this.textNewColor + '')} ] }) @@ -281,7 +281,7 @@ define([ split: true, menu: new Common.UI.Menu({ items: [ - {template: _.template('
    ')}, + {template: _.template('
    '), clsDropdownItem: false}, {template: _.template('' + this.textNewColor + '')} ] }) @@ -437,7 +437,7 @@ define([ caption: me.capBtnInsTable, menu: new Common.UI.Menu({ items: [ - {template: _.template('
    ')}, + {template: _.template('
    '), clsDropdownItem: false}, {caption: this.mniCustomTable, value: 'custom'}, {caption: this.mniDrawTable, value: 'draw', checkable: true}, {caption: this.mniEraseTable, value: 'erase', checkable: true} @@ -486,7 +486,7 @@ define([ menu: new Common.UI.Menu({ cls: 'menu-shapes', items: [ - {template: _.template('
    ')} + {template: _.template('
    '), clsDropdownItem: false} ] }) }); @@ -1086,7 +1086,8 @@ define([ '
    ' + '' + '' + - '
    ') + ''), + clsDropdownItem: false }); this.listStyles = new Common.UI.ComboDataView({ @@ -1622,7 +1623,7 @@ define([ new Common.UI.Menu({ style: 'min-width: 139px', items: [ - {template: _.template('')}, + {template: _.template(''), clsDropdownItem: false}, this.mnuMarkerSettings = new Common.UI.MenuItem({ caption: this.textListSettings, disabled: (this.mnuMarkersPicker.conf.index || 0)==0, @@ -1635,7 +1636,7 @@ define([ this.btnNumbers.setMenu( new Common.UI.Menu({ items: [ - {template: _.template('')}, + {template: _.template(''), clsDropdownItem: false}, this.mnuNumberSettings = new Common.UI.MenuItem({ caption: this.textListSettings, disabled: (this.mnuNumbersPicker.conf.index || 0)==0, @@ -1649,7 +1650,7 @@ define([ new Common.UI.Menu({ style: 'min-width: 90px', items: [ - {template: _.template('')}, + {template: _.template(''), clsDropdownItem: false}, this.mnuMultilevelSettings = new Common.UI.MenuItem({ caption: this.textListSettings, disabled: (this.mnuMultilevelPicker.conf.index || 0)==0, @@ -1693,7 +1694,7 @@ define([ this.btnInsertChart.setMenu( new Common.UI.Menu({ style: 'width: 364px;', items: [ - {template: _.template('')} + {template: _.template(''), clsDropdownItem: false} ] })); diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 1b45ece50..a66d300d2 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -137,7 +137,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } } @@ -325,7 +325,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } } diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index 244aa0e0e..c3d3a39a4 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -176,7 +176,7 @@ PE.ApplicationController = new(function(){ $ttEl = $('.hyperlink-tooltip'); $ttEl.tooltip({'container':'body', 'trigger':'manual'}); $ttEl.on('shown.bs.tooltip', function(e) { - $tooltip = $ttEl.data('bs.tooltip').tip(); + $tooltip = $($ttEl.data('bs.tooltip').getTipElement()); $tooltip.css({ left: $ttEl.ttpos[0] + ttOffset[0], diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 82edc9190..03987691a 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -121,7 +121,7 @@ } &.devider { - .dropdown-menu .divider; + .dropdown-menu .dropdown-divider; margin-top: 10px; margin-bottom: 10px; } @@ -203,7 +203,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } } @@ -388,7 +388,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } } diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 6b9a0bc31..ca1d1a457 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -509,7 +509,7 @@ SSE.ApplicationController = new(function(){ $ttEl = $('.hyperlink-tooltip'); $ttEl.tooltip({'container': 'body', 'trigger': 'manual'}); $ttEl.on('shown.bs.tooltip', function(e) { - $tooltip = $ttEl.data('bs.tooltip').tip(); + $tooltip = $($ttEl.data('bs.tooltip').getTipElement()); $tooltip.css({ left: $ttEl.ttpos[0] + ttOffset[0], diff --git a/apps/spreadsheeteditor/main/app/view/FormulaTab.js b/apps/spreadsheeteditor/main/app/view/FormulaTab.js index 92343ba62..5e59d798b 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaTab.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaTab.js @@ -350,7 +350,7 @@ define([ (li.length>0) && li.click(); Common.UI.Menu.Manager.hideAll(); } else if (e.namespace!=="after.bs.dropdown" && (e.keyCode == Common.UI.Keys.DOWN || e.keyCode == Common.UI.Keys.UP)) { - var $items = $('> [role=menu] > li:not(.divider):not(.disabled):visible', menu.$el).find('> a'); + var $items = $('> [role=menu] > li:not(.dropdown-divider):not(.disabled):visible', menu.$el).find('> a'); if (!$items.length) return; var index = $items.index($items.filter(':focus')), me = this; diff --git a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js index e0eb6bf0d..782482db6 100644 --- a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js @@ -260,7 +260,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', var me = this, tipdata = $(evt.target).tooltip({title: this.tipIsLocked,trigger:'manual'}).data('bs.tooltip'); - this.userTooltip = tipdata.tip(); + this.userTooltip = $(tipdata.getTipElement()); this.userTooltip.css('z-index', parseInt(this.$window.css('z-index')) + 10); tipdata.show(); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 86434fc0d..565181958 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -253,7 +253,7 @@ define([ '
    <%= item.exampleval ? item.exampleval : "" %>
    ', '', '<% }); %>', - '
  • ', + '
  • ' + me.textMoreFormats + '
  • ' ].join('')); diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 4ca403a1d..94ed8fdb7 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -111,7 +111,7 @@ } &.devider { - .dropdown-menu .divider; + .dropdown-menu .dropdown-divider; margin-top: 10px; margin-bottom: 10px; } @@ -232,7 +232,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } } @@ -441,7 +441,7 @@ } } - &.divider { + &.dropdown-divider { height: 10px; } }