From e05c2944e585a2944bc2b29f12928e7b6ab06528 Mon Sep 17 00:00:00 2001 From: liguohui Date: Wed, 31 Aug 2016 17:10:26 +0800 Subject: [PATCH] fix bug: The SweetAlert at the front page may out of the page if the content is too long. --- webapp/app/js/controllers/sourceMeta.js | 42 ++++++++++++++++++++++++++++----- webapp/app/less/component.less | 5 ++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js index e3ab0ac..abf393b 100755 --- a/webapp/app/js/controllers/sourceMeta.js +++ b/webapp/app/js/controllers/sourceMeta.js @@ -352,13 +352,28 @@ KylinApp }) if (result['result.unloaded'].length != 0 && result['result.loaded'].length == 0) { - SweetAlert.swal('Failed!', 'Failed to synchronize following table(s): ' + unloadedTableInfo, 'error'); + SweetAlert.swal({ + title: 'Failed!', + text: 'Failed to synchronize following table(s): ' + unloadedTableInfo, + type: 'error', + textClass: 'sweet-alert-text' + }); } if (result['result.loaded'].length != 0 && result['result.unloaded'].length == 0) { - SweetAlert.swal('Success!', 'The following table(s) have been successfully synchronized: ' + loadTableInfo, 'success'); + SweetAlert.swal({ + title: 'Success!', + text: 'The following table(s) have been successfully synchronized: ' + loadTableInfo, + type: 'success', + textClass: 'sweet-alert-text' + }); } if (result['result.loaded'].length != 0 && result['result.unloaded'].length != 0) { - SweetAlert.swal('Partial loaded!', 'The following table(s) have been successfully synchronized: ' + loadTableInfo + "\n\n Failed to synchronize following table(s):" + unloadedTableInfo, 'warning'); + SweetAlert.swal({ + title: 'Partial loaded!', + text: 'The following table(s) have been successfully synchronized: ' + loadTableInfo + "\n\n Failed to synchronize following table(s):" + unloadedTableInfo, + type: 'warning', + textClass: 'sweet-alert-text' + }); } loadingRequest.hide(); scope.aceSrcTbLoaded(true); @@ -400,13 +415,28 @@ KylinApp }) if (result['result.unload.fail'].length != 0 && result['result.unload.success'].length == 0) { - SweetAlert.swal('Failed!', 'Failed to synchronize following table(s): ' + unRemovedTableInfo, 'error'); + SweetAlert.swal({ + title: 'Failed!', + text: 'Failed to synchronize following table(s): ' + unRemovedTableInfo, + type: 'error', + textClass: 'sweet-alert-text' + }); } if (result['result.unload.success'].length != 0 && result['result.unload.fail'].length == 0) { - SweetAlert.swal('Success!', 'The following table(s) have been successfully synchronized: ' + removedTableInfo, 'success'); + SweetAlert.swal({ + title: 'Success!', + text: 'The following table(s) have been successfully synchronized: ' + removedTableInfo, + type: 'success', + textClass: 'sweet-alert-text' + }); } if (result['result.unload.success'].length != 0 && result['result.unload.fail'].length != 0) { - SweetAlert.swal('Partial unloaded!', 'The following table(s) have been successfully synchronized: ' + removedTableInfo + "\n\n Failed to synchronize following table(s):" + unRemovedTableInfo, 'warning'); + SweetAlert.swal({ + title: 'Partial unloaded!', + text: 'The following table(s) have been successfully synchronized: ' + removedTableInfo + "\n\n Failed to synchronize following table(s):" + unRemovedTableInfo, + type: 'warning', + textClass: 'sweet-alert-text' + }); } loadingRequest.hide(); scope.aceSrcTbLoaded(true); diff --git a/webapp/app/less/component.less b/webapp/app/less/component.less index e23859d..0b5d241 100644 --- a/webapp/app/less/component.less +++ b/webapp/app/less/component.less @@ -1174,3 +1174,8 @@ ul.abn-tree li.abn-tree-row a { .modal-body.streaming-source .ace_editor { height: 600px !important; } + +.sweet-alert-text { + max-height: 400px; + overflow-y: auto; +} -- 2.8.3.windows.1