Skip to content

Commit

Permalink
Prevents fade-in of modal forms in case of
Browse files Browse the repository at this point in the history
existing previous modal form.
Note: This is just a quick fix for the problem specified in the bug.
In general there are problems with using overlaying modals.
Each subsequent modal form doesn't 'backdrop' the previous one,
and the first modal could be closed without closing the last one.

Fixes bug 944502

Change-Id: I8086dcd14f5fbfb3c9d69a7f2f20e62e012b294e
  • Loading branch information
ttrifonov committed Mar 2, 2012
1 parent eb72487 commit 5d22379
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion horizon/static/horizon/js/horizon.js
Expand Up @@ -61,8 +61,9 @@ var Horizon = function() {
action_string = $action.text();
title = "Confirm " + action_string;
body = "Please confirm your selection. This action cannot be undone.";
var use_backdrop = $('.modal').length == 0; // check if already has a modal
modal = horizon.modals.create(title, body, action_string);
modal.modal('show');
modal.modal({backdrop: use_backdrop});
modal.find('.btn-primary').click(function (evt) {
form = $action.closest('form');
form.append("<input type='hidden' name='" + $action.attr('name') + "' value='" + $action.attr('value') + "'/>");
Expand Down

0 comments on commit 5d22379

Please sign in to comment.