From bb9d63b4eac3fc14d20ae87411994ce79e74a1ff Mon Sep 17 00:00:00 2001 From: bbaer Date: Fri, 18 Aug 2017 17:46:16 +0200 Subject: [PATCH 1/2] Added some padding to the alert window, removed the rounded edges, removed borders except the one at the bottom. --- less/qfq-bs.css.less | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/less/qfq-bs.css.less b/less/qfq-bs.css.less index f40a3f28..26bef344 100644 --- a/less/qfq-bs.css.less +++ b/less/qfq-bs.css.less @@ -12,7 +12,12 @@ z-index: 1000; .alert { + padding: 30px; + border-radius: 0px; margin-bottom: 2px; + border-top: none; + border-left: none; + border-right: none; } } @@ -25,6 +30,10 @@ i.@{spinner_class} { width: 16px; } +.alert-buttons { + margin-top: 10px; +} + /*inline elements in horizontal mode are too much left*/ .form-horizontal { .form-inline { -- GitLab From 6ab04814243b98ab69358559fa1f9c98b3ed4dc6 Mon Sep 17 00:00:00 2001 From: bbaer Date: Fri, 18 Aug 2017 17:46:48 +0200 Subject: [PATCH 2/2] Changes to the alert generation and added btn-group for multiple buttons. --- javascript/src/Alert.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/javascript/src/Alert.js b/javascript/src/Alert.js index 0fc74d22..2341e567 100644 --- a/javascript/src/Alert.js +++ b/javascript/src/Alert.js @@ -130,6 +130,7 @@ var QfqNS = QfqNS || {}; if (alertContainer.length === 0) { // No container so far, create one alertContainer = $("
").attr("id", n.Alert.constants.alertContainerId); + $("body").append(alertContainer); } @@ -178,6 +179,7 @@ var QfqNS = QfqNS || {}; */ n.Alert.prototype.getButtons = function () { var $buttons = null; + var $container = $("
").addClass("alert-buttons"); var numberOfButtons = this.buttons.length; var index; var buttonConfiguration; @@ -186,7 +188,11 @@ var QfqNS = QfqNS || {}; buttonConfiguration = this.buttons[index]; if (!$buttons) { - $buttons = $("
").addClass("alert-buttons"); + if (numberOfButtons > 1) { + $buttons = $("
").addClass("btn-group"); + } else { + $buttons = $container; + } } var focus = buttonConfiguration.focus ? buttonConfiguration.focus : false; @@ -197,6 +203,11 @@ var QfqNS = QfqNS || {}; .click(buttonConfiguration, this.buttonHandler.bind(this))); } + if (numberOfButtons > 1) { + $container.append($buttons); + $buttons = $container; + } + return $buttons; }; @@ -215,7 +226,7 @@ var QfqNS = QfqNS || {}; $alertContainer = this.makeAlertContainerSingleton(); if (this.modal) { this.$modalDiv = $("
"); - this.$modalDiv.css('width', Math.max(document.documentElement.clientWidth, window.innerWidth || 0)); + this.$modalDiv.css('width', "100%"); this.$modalDiv.css('height', Math.max(document.documentElement.clientHeight, window.innerHeight || 0)); } -- GitLab