Download:
child 7:94520aac0370
parent 5:1c231df1a171
6:d98a02185a99
Anton Shestakov <engored@ya.ru>, Thu, 16 May 2013 14:13:16 +0900
Make original jq-wrapped <option> element available in item functions.

1 файлов изменено, 4 вставок(+), 2 удалений(-) [+]
jquery.lensy.js file | annotate | diff | comparison | revisions
--- a/jquery.lensy.js Wed May 15 18:12:07 2013 +0900
+++ b/jquery.lensy.js Thu May 16 14:13:16 2013 +0900
@@ -58,16 +58,18 @@
.addClass(this.settings.itemClass)
.attr('data-original-value', value)
.attr('data-original-text', text)
- .html(this.settings.itemFn(value, text));
+ .data('$option', $option)
+ .html(this.settings.itemFn(value, text, $option));
},
createWidgetItem: function($item) {
var value = $item.attr('data-original-value');
var text = $item.attr('data-original-text');
+ var $option = $item.data('$option');
return $('<li>')
.addClass(this.settings.itemClass)
- .html((this.settings.widgetItemFn || this.settings.itemFn)(value, text));
+ .html((this.settings.widgetItemFn || this.settings.itemFn)(value, text, $option));
},
filter: function() {