From 65005a28053168a5c57aab75776c52ea3ee30eb1 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Sat, 16 Jan 2016 19:24:13 -0600 Subject: [PATCH] Moved modal closing to hide.bs.modal - Fixes #71 --- static/js/app/users.js | 6 +++++- templates/users.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/app/users.js b/static/js/app/users.js index feb0e9ac..10f310f1 100644 --- a/static/js/app/users.js +++ b/static/js/app/users.js @@ -25,6 +25,7 @@ function save(idx){ successFlash("Group updated successfully!") load() dismiss() + $("#modal").modal('hide') }) .error(function(data){ modalError(data.responseJSON.message) @@ -37,6 +38,7 @@ function save(idx){ successFlash("Group added successfully!") load() dismiss() + $("#modal").modal('hide') }) .error(function(data){ modalError(data.responseJSON.message) @@ -48,7 +50,6 @@ function dismiss(){ $("#targetsTable").dataTable().DataTable().clear().draw() $("#name").val("") $("#modal\\.flashes").empty() - $("#modal").modal('hide') } function edit(idx){ @@ -176,4 +177,7 @@ $(document).ready(function(){ .remove() .draw(); }) + $("#modal").on("hide.bs.modal", function(){ + dismiss() + }) }) diff --git a/templates/users.html b/templates/users.html index 4ee56f64..da1b731e 100644 --- a/templates/users.html +++ b/templates/users.html @@ -107,7 +107,7 @@