diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index ece6868f3..207f3b813 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -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') diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 57cb07fd2..d08b3409c 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -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); },