Skip to content

Commit

Permalink
Check if script is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Aug 14, 2024
1 parent e1b7ced commit 2e9d146
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions apps/documenteditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,8 @@ define([
},

onEditObject: function() {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;

if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand All @@ -1428,6 +1430,8 @@ define([
},

onDoubleClickOnChart: function(chart) {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;

var docProtection = this.documentHolder._docProtection;
if (this.mode.isEdit && !(this._isDisabled || docProtection.isReadOnly || docProtection.isFormsOnly || docProtection.isCommentsOnly)) {
var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
Expand All @@ -1440,6 +1444,8 @@ define([
},

onDoubleClickOnTableOleObject: function(chart) {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;

var docProtection = this.documentHolder._docProtection;
if (this.mode.isEdit && !(this._isDisabled || docProtection.isReadOnly || docProtection.isFormsOnly || docProtection.isCommentsOnly)) {
var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
Expand Down Expand Up @@ -1833,6 +1839,8 @@ define([
},

editChartClick: function(){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;

var diagramEditor = DE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
if (diagramEditor) {
diagramEditor.setEditMode(true);
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/main/app/view/ImageSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ define([
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));

this.btnEditObject.on('click', _.bind(function(btn){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down
1 change: 1 addition & 0 deletions apps/documenteditor/main/app/view/MailMergeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ define([
},

onEditData: function() {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
var mergeEditor = DE.getController('Common.Controllers.ExternalMergeEditor').getView('Common.Views.ExternalMergeEditor');
if (mergeEditor) {
mergeEditor.show();
Expand Down
1 change: 1 addition & 0 deletions apps/pdfeditor/main/app/view/ChartSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ define([
},

setEditData: function() {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
var diagramEditor = PE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');
if (diagramEditor) {
diagramEditor.setEditMode(true);
Expand Down
1 change: 1 addition & 0 deletions apps/pdfeditor/main/app/view/ImageSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ define([

this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down
3 changes: 3 additions & 0 deletions apps/presentationeditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,7 @@ define([
},

onDoubleClickOnTableOleObject: function(chart) {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.mode.isEdit && !this._isDisabled) {
var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor && chart) {
Expand Down Expand Up @@ -1577,6 +1578,7 @@ define([
},
/** coauthoring end **/
editChartClick: function(chart, placeholder){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.mode.isEdit && !this._isDisabled) {
var diagramEditor = PE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor');

Expand All @@ -1592,6 +1594,7 @@ define([
},

onEditObject: function() {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down
1 change: 1 addition & 0 deletions apps/presentationeditor/main/app/view/ImageSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ define([

this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down
2 changes: 2 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ define([
},

onEditObject: function() {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down Expand Up @@ -4324,6 +4325,7 @@ define([
},

onDoubleClickOnTableOleObject: function(obj) {
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.permissions.isEdit && !this._isDisabled) {
var oleEditor = SSE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor');
if (oleEditor && obj) {
Expand Down
4 changes: 2 additions & 2 deletions apps/spreadsheeteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ define([
},

onEditChart: function(btn) {
if (!this.editMode) return;
if (!this.editMode || !Common.Controllers.LaunchController.isScriptLoaded()) return;
var me = this, info = me.api.asc_getCellInfo();
var selectType = info.asc_getSelectionType();
if (selectType !== Asc.c_oAscSelectionType.RangeImage) {
Expand Down Expand Up @@ -1180,7 +1180,7 @@ define([
},

onEditChartType: function(btn) {
if (!this.editMode) return;
if (!this.editMode || !Common.Controllers.LaunchController.isScriptLoaded()) return;

var me = this;
var props;
Expand Down
2 changes: 1 addition & 1 deletion apps/spreadsheeteditor/main/app/view/ChartSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ define([
},

openAdvancedSettings: function() {
if (this.linkAdvanced.hasClass('disabled')) return;
if (this.linkAdvanced.hasClass('disabled') || !Common.Controllers.LaunchController.isScriptLoaded()) return;

var me = this;
var win, props;
Expand Down
1 change: 1 addition & 0 deletions apps/spreadsheeteditor/main/app/view/ImageSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ define([
this.spnHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);});
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnEditObject.on('click', _.bind(function(btn){
if (!Common.Controllers.LaunchController.isScriptLoaded()) return;
if (this.api) {
var oleobj = this.api.asc_canEditTableOleObject(true);
if (oleobj) {
Expand Down

0 comments on commit 2e9d146

Please sign in to comment.