diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-22 15:42:29 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-22 15:42:29 +0000 |
commit | 46b1a49453c4a71e98efb98f89e947dc73f95c65 (patch) | |
tree | 9babe0b6c55cd1f7b184506ed36978b97eaa0c7f /public/javascripts | |
parent | cd54e15a8d130ac22eeae91cc600e55d05212153 (diff) | |
download | redmine-46b1a49453c4a71e98efb98f89e947dc73f95c65.tar.gz redmine-46b1a49453c4a71e98efb98f89e947dc73f95c65.zip |
Use JQuery Dialog (#11445).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10070 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts')
-rw-r--r-- | public/javascripts/application.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index e3ac46245..0746817f4 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -273,33 +273,27 @@ function setPredecessorFieldsVisibility() { } function showModal(id, width) { - el = $('#'+id).first(); + var el = $('#'+id).first(); if (el.length == 0 || el.is(':visible')) {return;} - var h = $('body').height(); - var d = document.createElement("div"); - d.id = 'modalbg'; - $(d).appendTo('#main').css('width', '100%').css('height', h + 'px').show(); - - var pageWidth = $(window).width(); - if (width) { - el.css('width', width); - } - el.css('left', (((pageWidth - el.width())/2 *100) / pageWidth) + '%'); - el.addClass('modal'); - el.show(); - + var title = el.find('h3.title').text(); + el.dialog({ + width: width, + modal: true, + resizable: false, + dialogClass: 'modal', + title: title + }); el.find("input[type=text], input[type=submit]").first().focus(); } function hideModal(el) { var modal; if (el) { - modal = $(el).parents('div.modal').first(); + modal = $(el).parents('.ui-dialog-content'); } else { modal = $('#ajax-modal'); } - modal.hide(); - $('#modalbg').remove(); + modal.dialog("close"); } function submitPreview(url, form, target) { |