1
0
mirror of synced 2024-11-30 00:26:03 +03:00

allow url to be specified via data-ajax-url attribute. fixes #275

This commit is contained in:
Igor Vaynberg 2012-07-30 13:32:29 +03:00
parent 61603dacc0
commit e2ea6faac7

View File

@ -1,4 +1,4 @@
/* /*
Copyright 2012 Igor Vaynberg Copyright 2012 Igor Vaynberg
Version: @@ver@@ Timestamp: @@timestamp@@ Version: @@ver@@ Timestamp: @@timestamp@@
@ -563,7 +563,7 @@
// abstract // abstract
prepareOpts: function (opts) { prepareOpts: function (opts) {
var element, select, idKey; var element, select, idKey, ajaxUrl;
element = opts.element; element = opts.element;
@ -674,6 +674,10 @@
} else { } else {
if (!("query" in opts)) { if (!("query" in opts)) {
if ("ajax" in opts) { if ("ajax" in opts) {
ajaxUrl = opts.element.data("ajax-url");
if (ajaxUrl && ajaxUrl.length > 0) {
opts.ajax.url = ajaxUrl;
}
opts.query = ajax(opts.ajax); opts.query = ajax(opts.ajax);
} else if ("data" in opts) { } else if ("data" in opts) {
opts.query = local(opts.data); opts.query = local(opts.data);