added auto-scroll support...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-06-18 02:34:06 +03:00
parent ca96b6a36c
commit 97150a7985
2 changed files with 28 additions and 4 deletions

View File

@ -98,10 +98,12 @@
opacity: 0;
}
.browse .path .dir.cur:empty:hover:not([contenteditable]) {
opacity: 0.3;
opacity: 0.6;
}
.browse .path .dir.cur:empty:hover:not([contenteditable]):after {
content: "filter";
content: "______";
border: dashed white 1px;
cursor: text;
}
/* XXX need to make this resizable up but only to a certain size (~80vh) */
/*

View File

@ -92,9 +92,9 @@ var BrowserPrototype = {
General: {
pattern: '.browse',
Up: 'prev',
Up: 'prev!',
Backspace: 'Up',
Down: 'next',
Down: 'next!',
Left: 'pop',
Right: 'push',
@ -417,6 +417,28 @@ var BrowserPrototype = {
if(!filtering){
browser.find('.path .dir.cur').text(elem.text())
}
// handle scroll position...
var p = elem.scrollParent()
var S = p.scrollTop()
var H = p.height()
var h = elem.height()
var t = elem.offset().top - p.offset().top
var D = 3 * h
// XXX there is an error here...
// too low...
if(t+h+D > H){
p.scrollTop(S + (t+h+D) - H)
// too high...
} else if(t < D){
p.scrollTop(S + t - D)
}
return elem.addClass('selected')
}
}