Changeset 2838

Show
Ignore:
Timestamp:
07/25/08 00:25:05 (4 months ago)
Author:
bchoate
Message:

Fix for 'submit-once' forms so submit controls are re-enabled as page unloads, so navigating back will allow resubmits. BugId:85718

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-42/mt-static/mt.js

    r2735 r2838  
    14821482 
    14831483    eventSubmit: function( event ) { 
     1484        this.eventSubmitForm = undefined; 
     1485 
    14841486        var form = DOM.getFirstAncestorByTagName( event.target, "form", true ); 
    14851487        if ( !form ) 
    14861488            return; 
    1487              
     1489 
    14881490        if ( form.getAttribute( "mt:once" ) ) { 
    1489          
    14901491            if ( form.submitted ) 
    14911492                return event.stop(); 
    1492          
     1493 
     1494            this.eventSubmitForm = form; 
    14931495            this.toggleSubmit( form, true ); 
    14941496        } 
     
    15021504 
    15031505    eventBeforeUnload: function( event ) { 
     1506        /* re-enables disabled controls onunload, so they are enabled 
     1507           if the user navigates back */ 
     1508        if ( this.eventSubmitForm ) { 
     1509            this.toggleSubmit( this.eventSubmitForm, false ); 
     1510            this.submitted = false; 
     1511        } 
     1512 
    15041513        if ( this.changed ) { 
    15051514            if ( this.constructor.Editor )