@@ -1,4 +1,4 | |||
|
1 | $('#ajax-modal').html('<%= escape_javascript render partial: 'sudo_mode/new_modal' %>'); | |
|
2 | showModal('ajax-modal', '400px'); | |
|
1 | $("body").append($("<div>", {id: "sudo-modal"}).hide()); | |
|
2 | $('#sudo-modal').html('<%= escape_javascript render partial: 'sudo_mode/new_modal' %>'); | |
|
3 | showModal('sudo-modal', '400px'); | |
|
3 | 4 | $('#sudo_password').focus(); |
|
4 |
@@ -383,6 +383,8 function showModal(id, width, title) { | |||
|
383 | 383 | var el = $('#'+id).first(); |
|
384 | 384 | if (el.length === 0 || el.is(':visible')) {return;} |
|
385 | 385 | if (!title) title = el.find('h3.title').text(); |
|
386 | // moves existing modals behind the transparent background | |
|
387 | $(".modal").zIndex(99); | |
|
386 | 388 | el.dialog({ |
|
387 | 389 | width: width, |
|
388 | 390 | modal: true, |
@@ -401,6 +403,8 function hideModal(el) { | |||
|
401 | 403 | modal = $('#ajax-modal'); |
|
402 | 404 | } |
|
403 | 405 | modal.dialog("close"); |
|
406 | // restores existing modals in front of the transparent background | |
|
407 | $(".modal").zIndex(101); | |
|
404 | 408 | } |
|
405 | 409 | |
|
406 | 410 | function submitPreview(url, form, target) { |
General Comments 0
You need to be logged in to leave comments.
Login now