diff -r 5fb8d735fde0 -r 420608a77566 src/js/model.js --- a/src/js/model.js Thu Feb 06 12:29:31 2014 +0100 +++ b/src/js/model.js Thu Feb 06 14:43:30 2014 +0100 @@ -276,6 +276,26 @@ return res; }; +List.prototype.searchByTags = function(_text) { + if (!_text) { + this.trigger("clear-search"); + return this; + } + this.searching = true; + this.trigger("search", _text); + var rxsource = fullTextRegexps(_text), + rgxp = new RegExp(rxsource,"im"); + this.regexp = new RegExp(rxsource,"gim"); + var res = this.filter(function(_element, _k) { + var _isfound = rgxp.test(_element.getTagTexts()); + _element.found = _isfound; + _element.trigger(_isfound ? "found" : "not-found"); + return _isfound; + }); + this.trigger(res.length ? "found" : "not-found",res); + return res; +}; + List.prototype.getTitles = function() { return this.map(function(_el) { return _el.title;