Skip to content

Commit

Permalink
new options added
Browse files Browse the repository at this point in the history
  • Loading branch information
emposha committed Aug 16, 2011
1 parent 5b151d2 commit 1250ab1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -15,8 +15,6 @@ FCBKcomplete forks
------------------
https://github.com/CatoTH/FCBKcomplete

https://github.com/partoa/FCBKcomplete

Usage
-----
To activate FCBKcomplete:
Expand Down Expand Up @@ -64,9 +62,12 @@ Options
* input_tabindex - the tabindex of the input element
* input_min_size - minimum size of the input element (default: 1)
* input_name - value of the input element's 'name'-attribute (no 'name'-attribute set if empty)
* select_all_text - text for select all link

Changelog
---------
- 2.8.9.1 new options added input_min_size, select_all_text. The input_min_size added by @meteozond and @Александр, and select_all_text option added by @musketyr.

- 2.8.9 cache mechanizm changed (ported from @CatoTH fork with minor changes), new event added "oncreate" by @jrencz

- 2.8.8 added "width" paramater, added 109fd92, 5f4f529, ee59f2a fixes from @CatoTH fork
Expand Down
14 changes: 7 additions & 7 deletions jquery.fcbkcomplete.js
@@ -1,5 +1,5 @@
/**
FCBKcomplete v2.8.9 is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
FCBKcomplete v2.8.9.1 is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
- Jquery version required: 1.6.x
*/

Expand Down Expand Up @@ -53,10 +53,10 @@
complete = $('<div class="facebook-auto">').width(options.width);
if (options.complete_text != "") {
var completeText = options.complete_text;
if(options.select_all_text){
completeText += '<span style="float: right;"><a href="#" id="'+elemid+'_select_all" tabindex="10000" onclick="$(\'#' + elemid + '\').trigger(\'selectAll\');return false;">' + options.select_all_text + '</a></span>';
}
complete.append('<div class="default">' + completeText + '</div>');
if (options.select_all_text) {
complete.children('.default').append($('<a href="" class="select_all_items">' + options.select_all_text + '</a>').click(function(){$(element).trigger('selectAll'); return false;}));
}
}
complete.hover(function() {complete_hover = 0;}, function() {complete_hover = 1;});
feed = $('<ul id="'+elemid+'_feed"></ul>').width(options.width);
Expand Down Expand Up @@ -109,7 +109,7 @@

//public method to select all items
$(element).bind("selectAll", function(event, data) {
var currVals = $(element).val()
var currVals = $(element).val();
$.each($(element).data('cache'), function(key, value){
if($.inArray(key, $(element).val()) === -1){
addItem(value, key, 0, 0, 0);
Expand Down Expand Up @@ -195,8 +195,8 @@
});

holder.click( function() {
if (options.input_min_size < 0 && feed.length){
load_feed(xssPrevent(input.val(), 1))
if (options.input_min_size < 0 && feed.length) {
load_feed(xssPrevent(input.val(), 1));
}
input.focus();
if (feed.length && input.val().length > options.input_min_size) {
Expand Down

0 comments on commit 1250ab1

Please sign in to comment.