Sha256: 9399f16d02f78cf93e3fa529515fa596c9d725f58542ab21476cad642e022fd6

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

var socialCheesecake = socialCheesecake || {}; 
(function() {
	socialCheesecake.SearchEngine = function(settings) {
		this.parent = settings.parent;
	}

	socialCheesecake.SearchEngine.prototype.filter = function(pattern) {
		var actors = this.parent.grid.actors;
		var patt = new RegExp(pattern.toLowerCase());

		for(var i in actors) {
			var actor = actors[i];
			if(actor.name.toLowerCase().match(patt)) {
				actor.unfilter();
			} else {
				actor.filter();
			}
		}

		if(this.parent.highlightedSector) {
			this.parent.grid.fadeIn(this.parent.highlightedSector.actors, 100, true);
		} else {
			this.parent.grid.fadeIn(this.parent.grid.actors, 100, true);
		}
	}
})();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_cheesecake-0.4.0 app/assets/javascripts/socialcheesecake/search.js