Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C0860E00D1B; Thu, 22 Sep 2016 09:56:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.44 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A8821E00D1C for ; Thu, 22 Sep 2016 09:56:14 -0700 (PDT) Received: by mail-pa0-f44.google.com with SMTP id wk8so30990216pab.1 for ; Thu, 22 Sep 2016 09:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RNxsZK7H8Y9VxiQR4bptZ2cUHlW0KHMAmk21OzPS9x0=; b=gt/wDuFRy1swdL/+tcKIhJJM9kB8hiJGcQmLHz2pUM5kakGGnLpZyRcboEGIgkvdeJ cekg+i+KMMHteKi27vbmKkVDzKdiM2JXwJ5v3kvf2YyMNmaIyIYP1WADj4gtzUFbtqAX 4aM1DHrEhb9aA1ZNha85tviNUi16un1NGlo3MVk073LOGhIyS9rsc2M9ggf3GozSkhWk z+5TiTyZhZB+lTs7BUKbrpRLRQQzLMrxk30R7pFPQ2fIhy0T8hWEjiI/iBRvv1biLOAV 7pV7RD0px3r4uTz20Jnbj5yKT/0SatIVfM+k4sZEMu2RTvGLg7DRSecgAePIuIDCGWgd tihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RNxsZK7H8Y9VxiQR4bptZ2cUHlW0KHMAmk21OzPS9x0=; b=OirifCaLVJ6P4Wm0M672XbmFZmB0SLHSacPmV9x+DzG7SkTT2K/VpM3A0ntlO0P+mw nw00Vxvh09C/t5truLWE/5E1C3c/hRjIR+YwebjSJARGIfqsiaFD2VT+Y5QCw+KTelsL VQfTuPk7S0StCzUzDPOsTb/c7aHZtUzOe64Tq0fsmMnpLlKuCjDH9BOfNsoyOft9QDrM 8ZRg1tjKiigaIhBA8wRjuCTCpjgSENEJeuliFaYTRfSc5ywmkOiwruY2ZhYdD1PoD6km Et7LYeOoNUC2ULWsFPWjL7YbKj3Xgy+zcRwiiNeQ11iQb8h425DiQmzxD1+L8WKaVsrS bvmg== X-Gm-Message-State: AE9vXwMArvzg7OgHrH7GSkF8am52id4FAqf6+1fop72Va3T3sK+Hvi+uGHsvT69gbEEZ1TBF X-Received: by 10.66.34.101 with SMTP id y5mr4941634pai.95.1474563373614; Thu, 22 Sep 2016 09:56:13 -0700 (PDT) Received: from orion.ger.corp.intel.com ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id uj8sm5458889pab.5.2016.09.22.09.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 09:56:12 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 22 Sep 2016 17:55:49 +0100 Message-Id: <1474563354-11878-6-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474563354-11878-1-git-send-email-michael.g.wood@intel.com> References: <1474563354-11878-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 05/10] toaster: alerts and modals Avoid modals and alerts overlaying each other X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 16:56:28 -0000 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. Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js | 12 ++++++++++-- bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 13 ++++++++++--- 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 b79049e..e962224 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js @@ -6,7 +6,12 @@ * addToProject: Whether to add layers to project on accept * successAdd: function to run on success */ -function showLayerDepsModal(layer, dependencies, title, body, addToProject, successAdd) { +function showLayerDepsModal(layer, + dependencies, + title, + body, + addToProject, + successAdd) { if ($("#dependencies-modal").length === 0) { $.get(libtoaster.ctx.htmlUrl + "/layer_deps_modal.html", function(html){ @@ -43,7 +48,10 @@ function showLayerDepsModal(layer, dependencies, title, body, addToProject, succ $("#dependencies-modal").data("deps", dependencies); - $('#dependencies-modal').modal('show'); + /* Clear any alert notifications before showing the modal */ + $(".alert").fadeOut(function(){ + $('#dependencies-modal').modal('show'); + }); /* Discard the old submission function */ $("#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 8e2221d..0832ba4 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 () { } function _showChangeNotification(message){ - var alertMsg = $("#change-notification-msg"); + $(".alert").fadeOut().promise().done(function(){ + var alertMsg = $("#change-notification-msg"); - alertMsg.html(message); - $("#change-notification, #change-notification *").fadeIn(); + alertMsg.html(message); + $("#change-notification, #change-notification *").fadeIn(); + }); } function _createCustomRecipe(name, baseRecipeId, doneCb){ @@ -716,6 +718,11 @@ $(document).ready(function() { }); } + /* Make sure we don't have a notification overlay a modal */ + $(".modal").on('show.bs.modal', function(){ + $(".alert-dismissible").fadeOut(); + }); + if (libtoaster.debug) { check_for_duplicate_ids(); } else { -- 2.7.4