Prototype: make new insertion syntax work again on Ajax.Updater
This commit is contained in:
parent
5f4bab4dcb
commit
ae8d11d819
|
@ -260,8 +260,10 @@ Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
|
|||
|
||||
if (receiver = $(receiver)) {
|
||||
if (options.insertion) {
|
||||
if (typeof options.insertion == 'string')
|
||||
receiver.insert( {}[options.insertion] = response );
|
||||
if (typeof options.insertion == 'string') {
|
||||
var insertion = {}; insertion[options.insertion] = response;
|
||||
receiver.insert(insertion);
|
||||
}
|
||||
else options.insertion(receiver, response);
|
||||
}
|
||||
else receiver.update(response);
|
||||
|
|
|
@ -107,6 +107,12 @@
|
|||
new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: 'bottom' });
|
||||
wait(1000,function(){
|
||||
assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
|
||||
|
||||
$('content').update();
|
||||
new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: 'after' });
|
||||
wait(1000,function(){
|
||||
assertEqual('five dozen', $("content").next().innerHTML.strip().toLowerCase());
|
||||
});
|
||||
});
|
||||
});
|
||||
}},
|
||||
|
|
Loading…
Reference in New Issue