Sha256: 1b234e0db6192953163cf17fc09090fa3dd23e2dc55b0e76f1902b38f21ab40f

Contents?: true

Size: 1.42 KB

Versions: 30

Compression:

Stored size: 1.42 KB

Contents

/* ajax_windows.js.  Support for modal popup windows in Umlaut items. */
jQuery(document).ready(function($) {
   
    var shared_modal_d = $("<div></div>").dialog({autoOpen: false, modal: true, width: "400px"}) ;

    $("a.ajax_window").live("click", function(event) {                
        
        $(shared_modal_d).load(  this.href, function() {
            var heading = shared_modal_d.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
            $(shared_modal_d).dialog("option", "title", heading.text());
            $(shared_modal_d).dialog("open");
        });
        return false;
    });
    
    function ajax_form_catch(event) {
        $(shared_modal_d).load( $(event.target).closest("form").attr("action"), $(event.target).closest("form").serialize(), function() {
           var heading = shared_modal_d.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
           $(shared_modal_d).dialog("option", "title", heading.text());
           $(shared_modal_d).dialog("open");
           
        });
        return false;
    }
    
    //Trapping two events, click on the submit button or submit on the form
    //is strangely needed in IE7 to trap both return-in-field submits
    //and click-on-button submits. In FF just the second "submit" version
    //is sufficient. 
    $("form.modal_dialog_form input[type=submit]").live("click", ajax_form_catch );    
    $("form.modal_dialog_form").live( "submit", ajax_form_catch);
    

    
});

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
umlaut-3.0.3 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.2 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.1 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0rc1 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta10 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta9 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta8 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta7 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta6 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta5 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta4 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta3 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta2 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0beta1 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0alpha15 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0alpha14 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0alpha13 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0alpha12 app/assets/javascripts/umlaut/ajax_windows.js
umlaut-3.0.0alpha11 app/assets/javascripts/umlaut/ajax_windows.js