1
0
mirror of synced 2024-11-29 16:16:02 +03:00

fix ajax url() context. fixes #895

This commit is contained in:
Igor Vaynberg 2013-02-19 14:11:38 -08:00
parent 70be25cc6d
commit 38758d754b

View File

@ -355,14 +355,14 @@ the specific language governing permissions and limitations under the Apache Lic
type = options.type || 'GET', // set type of request (GET or POST)
params = {};
data = data ? data.call(self.opts.element, query.term, query.page, query.context) : null;
url = (typeof url === 'function') ? url.call(self.opts.element, query.term, query.page, query.context) : url;
data = data ? data.call(self, query.term, query.page, query.context) : null;
url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
if( null !== handler) { handler.abort(); }
if (options.params) {
if ($.isFunction(options.params)) {
$.extend(params, options.params.call(self.opts.element));
$.extend(params, options.params.call(self));
} else {
$.extend(params, options.params);
}
@ -383,7 +383,7 @@ the specific language governing permissions and limitations under the Apache Lic
query.callback(results);
}
});
handler = transport.call(self.opts.element, params);
handler = transport.call(self, params);
}, quietMillis);
};
}