From c9da4e972c145c486bd4131dc8d22fc88de474b1 Mon Sep 17 00:00:00 2001 From: Dmitry-Ilyushechkin Date: Mon, 17 Mar 2025 13:54:40 +0300 Subject: [PATCH] fix tooltip, style and code --- apps/common/embed/lib/controller/modals.js | 10 +++++++++- apps/common/embed/resources/less/common.less | 4 ++-- .../embed/js/ApplicationController.js | 15 ++++++++++----- .../embed/js/ApplicationController.js | 18 ++++++++++++++---- .../embed/js/ApplicationController.js | 16 +++++++++++++--- .../embed/js/ApplicationController.js | 18 ++++++++++++++---- 6 files changed, 62 insertions(+), 19 deletions(-) diff --git a/apps/common/embed/lib/controller/modals.js b/apps/common/embed/lib/controller/modals.js index 398481b1b1..a315719abe 100644 --- a/apps/common/embed/lib/controller/modals.js +++ b/apps/common/embed/lib/controller/modals.js @@ -152,8 +152,16 @@ config.callback(btn); } }); + + $dlgWarning.on('hidden.bs.modal', function() { + $dlgWarning.remove(); + }); - $dlgWarning.modal('show'); + $dlgWarning.modal({ + backdrop: 'static', + keyboard: false, + show: true + }); }; function updateEmbedCode(){ diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index e30de80722..2768c482a4 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -761,8 +761,8 @@ padding: 10px; .btn-primary { color: #fff; - background-color: #337ab7; - border-color: #2e6da4; + background-color: #7d858c; + border-color: #7d858c; } } } diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 07edb0c8ed..243b6d3947 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -47,7 +47,8 @@ DE.ApplicationController = new(function(){ bodyWidth = 0, requireUserAction = true; - var LoadingDocument = -256; + var LoadingDocument = -256, + WarningShown = false; // Initialize analytics // ------------------------- @@ -231,7 +232,7 @@ DE.ApplicationController = new(function(){ } function onDocMouseMoveEnd() { - if (me.isHideBodyTip) { + if (me.isHideBodyTip || WarningShown) { if ( $tooltip ) { $tooltip.tooltip('hide'); $tooltip = false; @@ -666,7 +667,7 @@ DE.ApplicationController = new(function(){ buttons: [] }); - $('#dlg-warning').css('z-index', 20002).modal({backdrop: 'static', keyboard: false, show: true}); + $('#dlg-warning').css('z-index', 20002); $('#dlg-warning button.close, #dlg-warning .modal-footer').remove(); return; } @@ -771,13 +772,17 @@ DE.ApplicationController = new(function(){ if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email) window.open(url, '_blank'); else { + WarningShown = true; common.controller.modals.showWarning({ title: me.txtTitleWarning, message: me.txtOpenWarning, buttons: [me.txtYes, me.txtNo], primary: me.txtYes, - callback: function(btn) { - (btn == me.txtYes) && window.open(url); + callback: function (btn) { + WarningShown = false; + if (btn === me.txtYes) { + window.open(url); + } } }); } diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index dd8cfeaad4..34ae0fba65 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -44,7 +44,8 @@ PE.ApplicationController = new(function(){ labelDocName, requireUserAction = true; - var LoadingDocument = -256; + var LoadingDocument = -256, + WarningShown = false; // Initialize analytics // ------------------------- @@ -216,6 +217,11 @@ PE.ApplicationController = new(function(){ } function onDocMouseMove(data) { + if (WarningShown) { + if ($tooltip) { + $tooltip.tooltip('hide'); + } + } if (data) { if (data.get_Type() == 1) { // hyperlink me.isHideBodyTip = false; @@ -535,7 +541,7 @@ PE.ApplicationController = new(function(){ buttons: [] }); - $('#dlg-warning').css('z-index', 20002).modal({backdrop: 'static', keyboard: false, show: true}); + $('#dlg-warning').css('z-index', 20002); $('#dlg-warning button.close, #dlg-warning .modal-footer').remove(); return; } @@ -613,13 +619,17 @@ PE.ApplicationController = new(function(){ if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email) window.open(url, '_blank'); else { + WarningShown = true; common.controller.modals.showWarning({ title: me.txtTitleWarning, message: me.txtOpenWarning, buttons: [me.txtYes, me.txtNo], primary: me.txtYes, - callback: function(btn) { - (btn == me.txtYes) && window.open(url); + callback: function (btn) { + WarningShown = false; + if (btn === me.txtYes) { + window.open(url); + } } }); } diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 8eccf1eda5..a6de237ff8 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -47,7 +47,8 @@ SSE.ApplicationController = new(function(){ ttOffset = [6, -15], labelDocName; - var LoadingDocument = -256; + var LoadingDocument = -256, + WarningShown = false; // Initialize analytics // ------------------------- @@ -663,13 +664,17 @@ SSE.ApplicationController = new(function(){ if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email) window.open(url, '_blank'); else { + WarningShown = true; common.controller.modals.showWarning({ title: me.txtTitleWarning, message: me.txtOpenWarning, buttons: [me.txtYes, me.txtNo], primary: me.txtYes, - callback: function(btn) { - (btn == me.txtYes) && window.open(url); + callback: function (btn) { + WarningShown = false; + if (btn === me.txtYes) { + window.open(url); + } } }); } @@ -837,6 +842,11 @@ SSE.ApplicationController = new(function(){ } function onApiMouseMove(array) { + if (WarningShown) { + if ($tooltip) { + $tooltip.tooltip('hide'); + } + } if ( array.length ) { var ttdata; for (var i = array.length; i > 0; i--) { diff --git a/apps/visioeditor/embed/js/ApplicationController.js b/apps/visioeditor/embed/js/ApplicationController.js index 40dbc01ab2..131ef1fde6 100644 --- a/apps/visioeditor/embed/js/ApplicationController.js +++ b/apps/visioeditor/embed/js/ApplicationController.js @@ -44,7 +44,8 @@ VE.ApplicationController = new(function(){ labelDocName, requireUserAction = true; - var LoadingDocument = -256; + var LoadingDocument = -256, + WarningShown = false; // Initialize analytics // ------------------------- @@ -357,6 +358,11 @@ VE.ApplicationController = new(function(){ } function onDocMouseMove(data) { + if (WarningShown) { + if ($tooltip) { + $tooltip.tooltip('hide'); + } + } if (data) { if (data.get_Type() == 1) { // hyperlink me.isHideBodyTip = false; @@ -605,7 +611,7 @@ VE.ApplicationController = new(function(){ buttons: [] }); - $('#dlg-warning').css('z-index', 20002).modal({backdrop: 'static', keyboard: false, show: true}); + $('#dlg-warning').css('z-index', 20002); $('#dlg-warning button.close, #dlg-warning .modal-footer').remove();; return; } @@ -656,13 +662,17 @@ VE.ApplicationController = new(function(){ if (type===AscCommon.c_oAscUrlType.Http || type===AscCommon.c_oAscUrlType.Email) window.open(url, '_blank'); else { + WarningShown = true; common.controller.modals.showWarning({ title: me.txtTitleWarning, message: me.txtOpenWarning, buttons: [me.txtYes, me.txtNo], primary: me.txtYes, - callback: function(btn) { - (btn == me.txtYes) && window.open(url); + callback: function (btn) { + WarningShown = false; + if (btn === me.txtYes) { + window.open(url); + } } }); }