added 'filtering' CSS class to indicate filtering...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-07-11 17:42:15 +03:00
parent 16b10e9bd7
commit 514a14046b
2 changed files with 17 additions and 7 deletions

View File

@ -203,6 +203,9 @@
float: right; float: right;
font-size: small; font-size: small;
} }
.browse.filtering .list div:before {
display: none;
}
.browse .list div:nth-of-type(1):before { .browse .list div:nth-of-type(1):before {
content: "1"; content: "1";

View File

@ -135,6 +135,7 @@ var BrowserPrototype = {
// XXX TEST: this should prevent event handler delegation... // XXX TEST: this should prevent event handler delegation...
keyboard: { keyboard: {
// XXX should we ignore numbers here???
FullPathEdit: { FullPathEdit: {
pattern: '.browse .path[contenteditable]', pattern: '.browse .path[contenteditable]',
@ -153,15 +154,17 @@ var BrowserPrototype = {
'A', 'A',
// let the system handle copy paste... // let the system handle copy paste...
'C', 'C', 'V', 'X',
'V',
'X', // enter numbers as-is...
'#1', '#2', '#3', '#4', '#5', '#6', '#7', '#8', '#9',
], ],
Enter: 'stopFullPathEdit!', Enter: 'stopFullPathEdit!',
Esc: 'abortFullPathEdit!', Esc: 'abortFullPathEdit!',
}, },
// XXX should we have things like ctrl-<number> for fast selection???
Filter: { Filter: {
pattern: '.browse .path div.cur[contenteditable]', pattern: '.browse .path div.cur[contenteditable]',
@ -178,9 +181,10 @@ var BrowserPrototype = {
'A', 'A',
// let the system handle copy paste... // let the system handle copy paste...
'C', 'C', 'V', 'X',
'V',
'X', // enter numbers as-is...
'#1', '#2', '#3', '#4', '#5', '#6', '#7', '#8', '#9',
], ],
Enter: 'action!', Enter: 'action!',
@ -339,7 +343,8 @@ var BrowserPrototype = {
// Indicate if UI in list filtering mode... // Indicate if UI in list filtering mode...
get filtering(){ get filtering(){
return this.dom.find('.path .dir.cur[contenteditable]').length > 0 return this.dom.hasClass('filtering')
//return this.dom.find('.path .dir.cur[contenteditable]').length > 0
}, },
// Get/set the path... // Get/set the path...
@ -823,6 +828,7 @@ var BrowserPrototype = {
var selection = window.getSelection() var selection = window.getSelection()
var that = this var that = this
this.dom.addClass('filtering')
var e = this.dom.find('.path .dir.cur') var e = this.dom.find('.path .dir.cur')
//.text('') //.text('')
.attr('contenteditable', true) .attr('contenteditable', true)
@ -839,6 +845,7 @@ var BrowserPrototype = {
}, },
stopFilter: function(){ stopFilter: function(){
this.filterList('*') this.filterList('*')
this.dom.removeClass('filtering')
this.dom.find('.path .dir.cur') this.dom.find('.path .dir.cur')
.text('') .text('')
.removeAttr('contenteditable') .removeAttr('contenteditable')