From 4e90d24dd9ff1474bf679f70a351dee371e87b51 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 29 Nov 2010 03:00:50 +0000 Subject: #818660 by yched, sun: Provide an AJAX command to invoke simple jQuery methods. --- misc/ajax.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'misc') diff --git a/misc/ajax.js b/misc/ajax.js index 127dd07ae..088d46df7 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -543,6 +543,14 @@ Drupal.ajax.prototype.commands = { $(response.selector).data(response.name, response.value); }, + /** + * Command to apply a jQuery method. + */ + invoke: function (ajax, response, status) { + var $element = $(response.selector); + $element[response.method].apply($element, response.arguments); + }, + /** * Command to restripe a table. */ -- cgit v1.2.3