Merge pull request #1727 from ONLYOFFICE/release/v7.1.0

Fix context menu: don't update scroll or select items in parent menu …
This commit is contained in:
Julia Radzhabova 2022-04-28 12:20:22 +03:00 committed by GitHub
commit 6a2b8157ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -377,12 +377,12 @@ define([
onBeforeShowMenu: function(e) {
Common.NotificationCenter.trigger('menu:show');
this.trigger('show:before', this, e);
this.alignPosition();
(e && e.target===e.currentTarget) && this.alignPosition();
},
onAfterShowMenu: function(e) {
this.trigger('show:after', this, e);
if (this.scroller) {
if (this.scroller && e && e.target===e.currentTarget) {
var menuRoot = this.menuRoot;
if (this.wheelSpeed===undefined) {
var item = menuRoot.find('> li:first'),
@ -664,7 +664,7 @@ define([
if (top + menuH > docH + cg.top) {
menuRoot.css('max-height', (docH - top) + 'px');
(!this.scroller) && (this.scroller = new Common.UI.Scroller({
el: this.$el.find('.dropdown-menu '),
el: this.$el.find('> .dropdown-menu '),
minScrollbarLength: 30,
suppressScrollX: true,
alwaysVisibleY: this.scrollAlwaysVisible
@ -975,12 +975,12 @@ define([
onBeforeShowMenu: function(e) {
Common.NotificationCenter.trigger('menu:show');
this.trigger('show:before', this, e);
this.alignPosition();
(e && e.target===e.currentTarget) && this.alignPosition();
},
onAfterShowMenu: function(e) {
this.trigger('show:after', this, e);
if (this.scroller) {
if (this.scroller && e && e.target===e.currentTarget) {
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
var menuRoot = this.menuRoot,
$selected = menuRoot.find('> li .checked');