From 278633279fe36ceaf4489509605ff2526cee58de Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 5 Aug 2016 14:40:47 +0300 Subject: [PATCH] [SSE] Fix bug 32282. --- .../main/app/controller/DocumentHolder.js | 18 ++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index db4dac223..d90ec45e8 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -960,7 +960,19 @@ define([ }, onApiHyperlinkClick: function(url) { - if (url && this.api.asc_getUrlType(url)>0) { + if (!url) { + Common.UI.alert({ + msg: this.errorInvalidLink, + title: this.notcriticalErrorTitle, + iconCls: 'warn', + buttons: ['ok'], + callback: _.bind(function(btn){ + Common.NotificationCenter.trigger('edit:complete', this.documentHolder); + }, this) + }); + return; + } + if (this.api.asc_getUrlType(url)>0) { var newDocumentPage = window.open(url, '_blank'); if (newDocumentPage) newDocumentPage.focus(); @@ -1540,7 +1552,9 @@ define([ textChangeRowHeight : 'Row Height {0} points ({1} pixels)', textInsertLeft : 'Insert Left', textInsertTop : 'Insert Top', - textSym : 'sym' + textSym : 'sym', + notcriticalErrorTitle: 'Warning', + errorInvalidLink: 'The link reference does not exist. Please correct the link or delete it.' }, SSE.Controllers.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index c406e83dc..5c24e0753 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -98,6 +98,8 @@ "SSE.Controllers.DocumentHolder.txtHeight": "Height", "SSE.Controllers.DocumentHolder.txtRowHeight": "Row Height", "SSE.Controllers.DocumentHolder.txtWidth": "Width", + "SSE.Controllers.DocumentHolder.notcriticalErrorTitle": "Warning", + "SSE.Controllers.DocumentHolder.errorInvalidLink": "The link reference does not exist. Please correct the link or delete it.", "SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet", "SSE.Controllers.LeftMenu.textByColumns": "By columns", "SSE.Controllers.LeftMenu.textByRows": "By rows",