tweaked api filtering a bit...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-03-30 17:42:48 +03:00
parent da60bb12d5
commit 20491386d6

View File

@ -128,6 +128,7 @@ var BrowserPrototype = {
// - disable nav in favor of editing // - disable nav in favor of editing
// - enter/blur to exit edit mode // - enter/blur to exit edit mode
// - esc to cancel and reset // - esc to cancel and reset
// XXX add a filter mode...
.click(function(){ .click(function(){
//that.update(path.concat($(this).text())) //that.update(path.concat($(this).text()))
$(this) $(this)
@ -167,19 +168,28 @@ var BrowserPrototype = {
var that = this var that = this
var browser = this.dom var browser = this.dom
var l = browser.find('.list>div') // show all...
if(pattern == null || pattern.trim() == '*'){
this.update()
l.each(function(i, e){ // basic filter...
e = $(e) } else {
var t = e.text() var l = browser.find('.list>div')
var i = t.search(pattern)
if(i < 0){
e.remove()
} else { l.each(function(i, e){
e.html(t.replace(pattern, pattern.bold())) e = $(e)
} var t = e.text()
}) var i = t.search(pattern)
if(i < 0){
e.remove()
} else {
e.html(t.replace(pattern, pattern.bold()))
}
})
}
return this
}, },
// internal actions... // internal actions...