From be7c3de41d35267023456d9e55ba528b03c8f2d5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Aug 2016 12:25:34 +0300 Subject: [PATCH] Limited size of warning window (use autosize or maximum width). --- apps/common/main/lib/component/Window.js | 4 ++++ apps/documenteditor/main/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 9cbe07b56..68c6cf7a4 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -434,6 +434,10 @@ define([ if (!options.dontshow) body.css('padding-bottom', '10px'); + if (options.maxwidth && options.width=='auto') { + if ((text.position().left + text.width() + parseInt(text_cnt.css('padding-right'))) > options.maxwidth) + options.width = options.maxwidth; + } if (options.width=='auto') { text_cnt.height(Math.max(text.height() + ((check.length>0) ? (check.height() + parseInt(check.css('margin-top'))) : 0), icon.height())); body.height(parseInt(text_cnt.css('height')) + parseInt(footer.css('height'))); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index a4a00d088..fa305a188 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -313,7 +313,7 @@ define([ if (!old_rights) Common.UI.warning({ title: this.notcriticalErrorTitle, - width: _.isEmpty(data.message) ? 'auto' : 350, + maxwidth: 600, msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message, callback: function(){ me._state.lostEditingRights = false; diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 1b7dd409e..693cac443 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -294,7 +294,7 @@ define([ if (!old_rights) Common.UI.warning({ title: this.notcriticalErrorTitle, - width: _.isEmpty(data.message) ? 'auto' : 350, + maxwidth: 600, msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message, callback: function(){ me._state.lostEditingRights = false; diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index a328e09c2..b839d47e6 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -325,7 +325,7 @@ define([ if (!old_rights) Common.UI.warning({ title: this.notcriticalErrorTitle, - width: _.isEmpty(data.message) ? 'auto' : 350, + maxwidth: 600, msg : _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message, callback: function(){ me._state.lostEditingRights = false;