summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-09-26 13:59:32 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-30 16:52:22 +0100
commitd209f8b7afc1e6847ac68e23a1389230fdd6768d (patch)
tree1bf0775d21f089919d887df6ac6a0404f33b2fb1 /bitbake/lib
parent0d70606022cad010f586ec29b558ee902be765ef (diff)
downloadpoky-d209f8b7afc1e6847ac68e23a1389230fdd6768d.tar.gz
bitbake: toaster: alerts and modals Avoid modals and alerts overlaying each other
Make sure that when we spawn a modal we clear any notifications and also make sure that old notifications are cleared before showing a new one. (Bitbake rev: c7f30a673ab973a2500092d2e981a47da05fbf12) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js12
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/libtoaster.js13
2 files changed, 20 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js b/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
index b79049e98c..e9622243a5 100644
--- a/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
+++ b/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
@@ -6,7 +6,12 @@
6 * addToProject: Whether to add layers to project on accept 6 * addToProject: Whether to add layers to project on accept
7 * successAdd: function to run on success 7 * successAdd: function to run on success
8 */ 8 */
9function showLayerDepsModal(layer, dependencies, title, body, addToProject, successAdd) { 9function showLayerDepsModal(layer,
10 dependencies,
11 title,
12 body,
13 addToProject,
14 successAdd) {
10 15
11 if ($("#dependencies-modal").length === 0) { 16 if ($("#dependencies-modal").length === 0) {
12 $.get(libtoaster.ctx.htmlUrl + "/layer_deps_modal.html", function(html){ 17 $.get(libtoaster.ctx.htmlUrl + "/layer_deps_modal.html", function(html){
@@ -43,7 +48,10 @@ function showLayerDepsModal(layer, dependencies, title, body, addToProject, succ
43 48
44 $("#dependencies-modal").data("deps", dependencies); 49 $("#dependencies-modal").data("deps", dependencies);
45 50
46 $('#dependencies-modal').modal('show'); 51 /* Clear any alert notifications before showing the modal */
52 $(".alert").fadeOut(function(){
53 $('#dependencies-modal').modal('show');
54 });
47 55
48 /* Discard the old submission function */ 56 /* Discard the old submission function */
49 $("#dependencies-modal-form").unbind('submit'); 57 $("#dependencies-modal-form").unbind('submit');
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index 8e2221d2ae..0832ba40c3 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -342,10 +342,12 @@ var libtoaster = (function () {
342 } 342 }
343 343
344 function _showChangeNotification(message){ 344 function _showChangeNotification(message){
345 var alertMsg = $("#change-notification-msg"); 345 $(".alert").fadeOut().promise().done(function(){
346 var alertMsg = $("#change-notification-msg");
346 347
347 alertMsg.html(message); 348 alertMsg.html(message);
348 $("#change-notification, #change-notification *").fadeIn(); 349 $("#change-notification, #change-notification *").fadeIn();
350 });
349 } 351 }
350 352
351 function _createCustomRecipe(name, baseRecipeId, doneCb){ 353 function _createCustomRecipe(name, baseRecipeId, doneCb){
@@ -716,6 +718,11 @@ $(document).ready(function() {
716 }); 718 });
717 } 719 }
718 720
721 /* Make sure we don't have a notification overlay a modal */
722 $(".modal").on('show.bs.modal', function(){
723 $(".alert-dismissible").fadeOut();
724 });
725
719 if (libtoaster.debug) { 726 if (libtoaster.debug) {
720 check_for_duplicate_ids(); 727 check_for_duplicate_ids();
721 } else { 728 } else {