Sha256: 60bef87e4a2b532ba32a858eeceed8d3f78a7231d284d7c42c2a705abccfd2bb

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

/*! jQuery Searcher Plugin - v0.1.0 - 2014-01-06
 * https://github.com/lloiser/jquery-searcher/
 * Copyright (c) 2014 Lukas Beranek; Licensed MIT 
*/
!function(a){"use strict";function b(b,c){this.element=b,this.options=a.extend({},e,c),this._create()}var c="searcher",d="plugin_"+c,e={itemSelector:"tbody > tr",textSelector:"td",inputSelector:"",caseSensitive:!1,toggle:function(b,c){a(b).toggle(c)}};b.prototype={_create:function(){this._$element=a(this.element);var b=a.proxy(this._onValueChange,this);this._$input=a(this.options.inputSelector).bind("input change keyup",b),this._lastValue=""},_onValueChange:function(){var b=this.options,c=b.textSelector,d=b.caseSensitive,e=b.toggle,f=this._$input.val();d||(f=f.toLowerCase()),f!==this._lastValue&&(this._lastValue=f,this._$element.find(b.itemSelector).each(function(){var b=a(this),g=b;c&&(g=b.find(c)),g=g.filter(function(){var b=a(this).text();return d||(b=b.toLowerCase()),b.indexOf(f)>=0}),e(this,g.length>0)}))}},a.fn[c]=function(c){return this.each(function(){var e=a.data(this,d);e?a.extend(e.options,c):a.data(this,d,new b(this,c))})}}(jQuery,window,document);

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
goatmail-1.2.0 lib/goatmail/assets/javascripts/jquery.searcher.min.js
goatmail-1.1.1 lib/goatmail/assets/javascripts/jquery.searcher.min.js
goatmail-1.1.0 lib/goatmail/assets/javascripts/jquery.searcher.min.js
letter_opener-web-0.2.0 lib/letter_opener/web/assets/javascripts/jquery.searcher.min.js
goatmail-1.0.0 lib/goatmail/assets/javascripts/jquery.searcher.min.js