diff --git a/apps/documenteditor/main/app/controller/Links.js b/apps/documenteditor/main/app/controller/Links.js index fdd1a2a24..28193dd4b 100644 --- a/apps/documenteditor/main/app/controller/Links.js +++ b/apps/documenteditor/main/app/controller/Links.js @@ -94,10 +94,8 @@ define([ this.api.asc_registerCallback('asc_onCanAddHyperlink', _.bind(this.onApiCanAddHyperlink, this)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); - this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowControlsActions, this)); - this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideControlsActions, this)); - // this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); - // this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); + this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); + this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); } return this; @@ -354,8 +352,9 @@ define([ })).show(); }, - onShowContentControlsActions: function(action, x, y) { - var menu = (action==1) ? this.view.contentsUpdateMenu : this.view.contentsMenu, + onShowTOCActions: function(obj, x, y) { + var action = obj.button, + menu = (action==AscCommon.CCButtonType.Toc) ? this.view.contentsUpdateMenu : this.view.contentsMenu, documentHolderView = this.getApplication().getController('DocumentHolder').documentHolder, menuContainer = documentHolderView.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)), me = this; @@ -394,15 +393,22 @@ define([ onHideContentControlsActions: function() { this.view.contentsMenu && this.view.contentsMenu.hide(); this.view.contentsUpdateMenu && this.view.contentsUpdateMenu.hide(); + var controlsContainer = this.getApplication().getController('DocumentHolder').documentHolder.cmpEl.find('#calendar-control-container'); + if (controlsContainer.is(':visible')) + controlsContainer.hide(); }, - onShowControlsActions: function(action, x, y) { - var documentHolderView = this.getApplication().getController('DocumentHolder').documentHolder, + onShowDateActions: function(obj, x, y) { + var action = obj.button, + props = obj.pr, + specProps = props.get_DateTimePr(), + id = props.get_InternalId(), + documentHolderView = this.getApplication().getController('DocumentHolder').documentHolder, controlsContainer = documentHolderView.cmpEl.find('#calendar-control-container'), me = this; if (controlsContainer.length < 1) { - controlsContainer = $('