[PE] Fix Bug 59908

This commit is contained in:
Julia Radzhabova 2022-11-29 12:53:43 +03:00
parent 02be3055da
commit 1102a2f762
2 changed files with 11 additions and 1 deletions

View file

@ -2163,7 +2163,7 @@ define([
onGuidesClick: function(menu, item) {
if (item.value == 'del-guide' && item.options.guideId)
this.api.asc_deleteGuide(item.options.guideId);
this.documentHolder.fireEvent('guides:delete', [item.options.guideId]);
else if (item.value === 'add-vert' || item.value === 'add-hor')
this.documentHolder.fireEvent('guides:add', [item.value]);
else if (item.value === 'clear')

View file

@ -123,6 +123,7 @@ define([
'DocumentHolder': {
'guides:show': _.bind(this.onGuidesShow, this),
'guides:add': _.bind(this.onGuidesAdd, this),
'guides:delete': _.bind(this.onGuidesDelete, this),
'guides:clear': _.bind(this.onGuidesClear, this),
'guides:smart': _.bind(this.onGuidesSmartShow, this),
'gridlines:show': _.bind(this.onGridlinesShow, this),
@ -277,8 +278,17 @@ define([
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onGuidesDelete: function(id) {
this.api.asc_deleteGuide(id);
this.api.asc_getShowGuides() && (this.api.asc_getGuidesCount()<1) && this.onGuidesShow(false);
Common.NotificationCenter.trigger('edit:complete', this.view);
},
onGuidesClear: function() {
this.api.asc_clearGuides();
this.api.asc_getShowGuides() && this.onGuidesShow(false);
Common.NotificationCenter.trigger('edit:complete', this.view);
},