1
0
mirror of synced 2025-02-16 20:13:16 +03:00

minor cosmetic cleanup

This commit is contained in:
Igor Vaynberg 2012-06-14 09:39:23 -07:00
parent 08d4485400
commit 16c868934d

View File

@ -268,15 +268,15 @@
* the text.
*/
function local(options) {
var data = options, // data elements,
dataText = '',
var data = options, // data elements
dataText,
text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
if (!$.isArray(data)) {
text = data.text;
// if text is not a function we assume it to be a key name
if (!$.isFunction(text)) {
dataText = data.text; // we need to store this in a seperate variable because in the next step data gets reset and data.text is no longer available
dataText = data.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
text = function (item) { return item[dataText]; };
}
data = data.results;