Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6558

Show
Ignore:
Timestamp:
04/24/07 03:58:34 (1 year ago)
Author:
sam
Message:

prototype: Add support for per-request onCreate callbacks to Ajax.Request. Closes #8011.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r6557 r6558  
    11*SVN* 
     2 
     3* Add support for per-request onCreate callbacks to Ajax.Request.  Closes #8011.  [Andrew Dupont] 
    24 
    35* Don't call evalResponse() when an Ajax response has no Content-type header.  Closes #7827.  [Tobie Langel] 
  • spinoffs/prototype/trunk/src/ajax.js

    r6557 r6558  
    102102       
    103103    try { 
     104      if (this.options.onCreate) this.options.onCreate(this.transport); 
    104105      Ajax.Responders.dispatch('onCreate', this, this.transport); 
    105106     
  • spinoffs/prototype/trunk/test/unit/ajax.html

    r5992 r6558  
    166166        } 
    167167      }); 
     168    }}, 
     169     
     170    testOnCreateCallback: function() {with(this) { 
     171      new Ajax.Request("fixtures/content.html", { 
     172        asynchronous: false, 
     173        onCreate: function(transport) { assertEqual(0, transport.readyState) }, 
     174        onComplete: function(transport) { assertNotEqual(0, transport.readyState) } 
     175      }); 
    168176    }} 
    169177