Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

populating scope parameter in Ajax.Updater

  • Loading branch information...
commit ab057214ea6718bc098cb816d8c243d60626b2f1 1 parent f78402b
@juzna authored
Showing with 11 additions and 4 deletions.
  1. +9 −2 src/prototype/ajax/updater.js
  2. +2 −2 src/prototype/dom/dom.js
View
11 src/prototype/ajax/updater.js
@@ -116,14 +116,21 @@ Ajax.Updater = Class.create(Ajax.Request, {
if (!options.evalScripts) responseText = responseText.stripScripts();
if (receiver = $(receiver)) {
+ // Get scope
+ var _scope;
+ try {
+ _scope = this.options.scope || window.Scope && Scope.get(receiver, this.options.scopeName);
+ if(_scope) _scope._el = receiver;
+ } catch(e) {}
+
if (options.insertion) {
if (Object.isString(options.insertion)) {
var insertion = { }; insertion[options.insertion] = responseText;
- receiver.insert(insertion);
+ receiver.insert(insertion, _scope);
}
else options.insertion(receiver, responseText);
}
- else receiver.update(responseText);
+ else receiver.update(responseText, _scope);
}
}
});
View
4 src/prototype/dom/dom.js
@@ -801,7 +801,7 @@ Element.Methods = {
* after: "<hr>"
* });
**/
- insert: function(element, insertions) {
+ insert: function(element, insertions, scope) {
element = $(element);
if (Object.isString(insertions) || Object.isNumber(insertions) ||
@@ -831,7 +831,7 @@ Element.Methods = {
if (position == 'top' || position == 'after') childNodes.reverse();
childNodes.each(insert.curry(element));
- content.evalScripts.bind(content, element).defer();
+ String.prototype.evalScripts.cal(content, element, scope);
}
return element;
Please sign in to comment.
Something went wrong with that request. Please try again.