X-Git-Url: https://git.mdrn.pl/ReadingsJQM.git/blobdiff_plain/e5d84d972b58e6a9f3e071a80036ae07f1b2b068..389b7f33e7f11786f5d3dcc5ad9f3115bf96cc6b:/js/jqm.autoComplete.min-1.3.js diff --git a/js/jqm.autoComplete.min-1.3.js b/js/jqm.autoComplete.min-1.3.js new file mode 100644 index 0000000..e9e2516 --- /dev/null +++ b/js/jqm.autoComplete.min-1.3.js @@ -0,0 +1,10 @@ +/* + Name: autoComplete + Author: Raymond Camden & Andy Matthews + Contributors: Jim Pease (@jmpease) + Website: http://raymondcamden.com/ + http://andyMatthews.net + Packed With: http://jsutility.pjoneil.net/ + Version: 1.3 + */ +(function($){"use strict";var defaults={target:$(),source:null,callback:null,link:null,minLength:0,transition:'fade'},buildItems=function($this,data,settings){var str=[];$.each(data,function(index,value){if($.isPlainObject(value)){str.push('
  • '+value.label+'
  • ')}else{str.push('
  • '+value+'
  • ')}});$(settings.target).html(str.join('')).listview("refresh");if(settings.callback!=null&&$.isFunction(settings.callback)){attachCallback(settings)}if(str.length>0){$this.trigger("targetUpdated.autocomplete")}else{$this.trigger("targetCleared.autocomplete")}},attachCallback=function(settings){$('li a',$(settings.target)).bind('click.autocomplete',function(e){e.stopPropagation();e.preventDefault();settings.callback(e)})},clearTarget=function($this,$target){$target.html('').listview('refresh');$this.trigger("targetCleared.autocomplete")},handleInput=function(e){var $this=$(this),text,data,settings=$this.jqmData("autocomplete");if(settings){text=$this.val();if(text.length