Commit ce8d332d authored by Julia Radzhabova's avatar Julia Radzhabova

Delete unused method "applyEditRights" from api.

parent 00f8c803
......@@ -270,7 +270,7 @@
res;
if (msg.event === 'onRequestEditRights' && !handler) {
_applyEditRights(false, 'handler is\'n defined');
_applyEditRights(false, 'handler isn\'t defined');
} else if (msg.event === 'onInternalMessage' && msg.data && msg.data.type == 'localstorage') {
_callLocalStorage(msg.data.data);
} else {
......@@ -546,7 +546,6 @@
return {
showError : _showError,
showMessage : _showMessage,
applyEditRights : _applyEditRights,
processSaveResult : _processSaveResult,
processRightsChange : _processRightsChange,
denyEditingRights : _denyEditingRights,
......
......@@ -708,65 +708,14 @@ define([
},
onApplyEditRights: function(data) {
var application = this.getApplication();
application.getController('Statusbar').setStatusCaption('');
if (data) {
if (data.allowed) {
data.requestrights = true;
this.appOptions.isEdit= true;
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
var me = this;
setTimeout(function(){
me.applyModeCommonElements();
me.applyModeEditorElements();
me.api.asc_setViewMode(false);
var timer_rp = setInterval(function(){
clearInterval(timer_rp);
var toolbarController = application.getController('Toolbar'),
rightmenuController = application.getController('RightMenu'),
leftmenuController = application.getController('LeftMenu'),
documentHolderController = application.getController('DocumentHolder'),
fontsControllers = application.getController('Common.Controllers.Fonts');
leftmenuController.setMode(me.appOptions).createDelayedElements();
rightmenuController.createDelayedElements();
Common.NotificationCenter.trigger('layout:changed', 'main');
var timer_sl = setInterval(function(){
if (window.styles_loaded) {
clearInterval(timer_sl);
documentHolderController.getView('DocumentHolder').createDelayedElements();
documentHolderController.getView('DocumentHolder').changePosition();
me.loadLanguages();
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
me.fillTextArt(me.api.asc_getTextArtPreviews());
me.updateThemeColors();
toolbarController.activateControls();
this.getApplication().getController('Statusbar').setStatusCaption('');
me.api.UpdateInterfaceState();
}
}, 50);
},50);
}, 100);
} else {
if (data && !data.allowed) {
Common.UI.info({
title: this.requestEditFailedTitleText,
msg: data.message || this.requestEditFailedMessageText
});
}
}
},
onDocumentContentReady: function() {
......
......@@ -510,68 +510,14 @@ define([
},
onApplyEditRights: function(data) {
var application = this.getApplication();
application.getController('Statusbar').setStatusCaption('');
if (data) {
if (data.allowed) {
data.requestrights = true;
this.appOptions.isEdit= true;
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
var me = this;
setTimeout(function(){
me.applyModeCommonElements();
me.applyModeEditorElements('view');
me.api.asc_setViewMode(false);
var timer_rp = setInterval(function(){
clearInterval(timer_rp);
var toolbarController = application.getController('Toolbar'),
viewportController = application.getController('Viewport'),
rightmenuController = application.getController('RightMenu'),
leftmenuController = application.getController('LeftMenu'),
documentHolderController = application.getController('DocumentHolder'),
fontsControllers = application.getController('Common.Controllers.Fonts');
leftmenuController.setMode(me.appOptions).createDelayedElements();
rightmenuController.createDelayedElements();
Common.NotificationCenter.trigger('layout:changed', 'main');
var timer_sl = setInterval(function(){
if (window.styles_loaded) {
clearInterval(timer_sl);
documentHolderController.getView('DocumentHolder').createDelayedElements();
documentHolderController.getView('DocumentHolder').changePosition();
// me.getController('Common.controller.CommentsPopover').onDocumentContentReady();
// me.getController('Search').setMode({isEdit: me.modeEdit});
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me));
me.api.asc_registerCallback('asc_onUpdateLayout', _.bind(me.fillLayoutsStore, me)); // slide layouts loading
me.updateThemeColors();
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
me.fillTextArt(me.api.asc_getTextArtPreviews());
toolbarController.activateControls();
this.getApplication().getController('Statusbar').setStatusCaption('');
me.api.UpdateInterfaceState();
}
}, 50);
},50);
}, 100);
} else {
if (data && !data.allowed) {
Common.UI.info({
title: this.requestEditFailedTitleText,
msg: data.message || this.requestEditFailedMessageText
});
}
}
},
onDocumentContentReady: function() {
......
......@@ -514,58 +514,12 @@ define([
},
onApplyEditRights: function(data) {
if (data) {
if (data.allowed) {
this.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'],ApplyEditRights);
this.appOptions.isEdit = true;
var me = this;
setTimeout(function(){
me.applyModeCommonElements();
me.applyModeEditorElements('view');
me.api.asc_setViewMode(false);
var application = me.getApplication();
var documentHolderController = application.getController('DocumentHolder');
application.getController('LeftMenu').setMode(me.appOptions).createDelayedElements();
Common.NotificationCenter.trigger('layout:changed', 'main');
var timer_sl = setInterval(function(){
if (window.styles_loaded) {
clearInterval(timer_sl);
documentHolderController.getView('DocumentHolder').createDelayedElements();
documentHolderController.resetApi();
application.getController('Toolbar').createDelayedElements();
application.getController('RightMenu').createDelayedElements();
application.getController('Statusbar').getView('Statusbar').update();
application.getController('CellEditor').setMode(me.appOptions);
me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
var shapes = me.api.asc_getPropertyEditorShapes();
if (shapes)
me.fillAutoShapes(shapes[0], shapes[1]);
me.fillTextArt(me.api.asc_getTextArtPreviews());
me.updateThemeColors();
application.getController('FormulaDialog').setApi(me.api);
}
}, 50);
}, 50);
}
else {
if (data && !data.allowed) {
Common.UI.info({
title: this.requestEditFailedTitleText,
msg: data.message || this.requestEditFailedMessageText
});
}
}
},
onDocumentReady: function() {
......
......@@ -435,68 +435,6 @@ define([
}
},
onApplyEditRights: function(data) {
// var application = this.getApplication();
// application.getController('Statusbar').setStatusCaption('');
//
// if (data) {
// if (data.allowed) {
// data.requestrights = true;
// this.appOptions.isEdit= true;
//
// this.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction,ApplyEditRights);
//
// var me = this;
// setTimeout(function(){
// me.applyModeCommonElements();
// me.applyModeEditorElements();
// me.api.asc_setViewMode(false);
//
// var timer_rp = setInterval(function(){
// clearInterval(timer_rp);
//
// var toolbarController = application.getController('Toolbar'),
// rightmenuController = application.getController('RightMenu'),
// leftmenuController = application.getController('LeftMenu'),
// documentHolderController = application.getController('DocumentHolder'),
// fontsControllers = application.getController('Common.Controllers.Fonts');
//
// leftmenuController.setMode(me.appOptions).createDelayedElements();
//
// rightmenuController.createDelayedElements();
//
// Common.NotificationCenter.trigger('layout:changed', 'main');
//
// var timer_sl = setInterval(function(){
// if (window.styles_loaded) {
// clearInterval(timer_sl);
//
// documentHolderController.getView('DocumentHolder').createDelayedElements();
// documentHolderController.getView('DocumentHolder').changePosition();
// me.loadLanguages();
//
// var shapes = me.api.asc_getPropertyEditorShapes();
// if (shapes)
// me.fillAutoShapes(shapes[0], shapes[1]);
//
// me.fillTextArt(me.api.asc_getTextArtPreviews());
// me.updateThemeColors();
// toolbarController.activateControls();
//
// me.api.UpdateInterfaceState();
// }
// }, 50);
// },50);
// }, 100);
// } else {
// Common.UI.info({
// title: this.requestEditFailedTitleText,
// msg: data.message || this.requestEditFailedMessageText
// });
// }
// }
},
onDocumentContentReady: function() {
if (this._isDocReady)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment