keybind: x: thread hiding

This commit is contained in:
James Campos 2011-04-10 14:15:32 -07:00
parent 96daa0aa3a
commit efc50456fd
2 changed files with 24 additions and 12 deletions

View File

@ -742,9 +742,11 @@
case 'u': case 'u':
break; break;
case 'w': case 'w':
thread = nav.getThread()[0]; thread = nav.getThread();
return watcher.toggle(thread); return watcher.toggle(thread);
case 'x': case 'x':
thread = nav.getThread();
threadHiding.toggle(thread);
} }
} }
}; };
@ -1436,11 +1438,16 @@
return threadHiding.hide(thread); return threadHiding.hide(thread);
}, },
show: function(e) { show: function(e) {
var div, thread; var thread;
div = e.target.parentNode; thread = e.target.parentNode.parentNode;
thread = div.parentNode; return threadHiding.show(thread);
threadHiding.show(thread); }
return $.remove(div); },
toggle: function(thread) {
if (thread.className.indexOf('stub') !== -1 || thread.style.display === 'none') {
return threadHiding.show(thread);
} else {
return threadHiding.hide(thread);
} }
}, },
hide: function(thread) { hide: function(thread) {
@ -1480,6 +1487,7 @@
}, },
show: function(thread) { show: function(thread) {
var hiddenThreads, id; var hiddenThreads, id;
$.remove($('div.block', thread));
$.removeClass(thread, 'stub'); $.removeClass(thread, 'stub');
$.show(thread); $.show(thread);
$.show(thread.nextSibling); $.show(thread.nextSibling);

View File

@ -562,13 +562,13 @@ keybinds =
#update now #update now
return return
when 'w' when 'w'
[thread] = nav.getThread() thread = nav.getThread()
watcher.toggle thread watcher.toggle thread
when 'x' when 'x'
#toggle hide thread thread = nav.getThread()
threadHiding.toggle thread
return return
keyModeNormal = (e) -> keyModeNormal = (e) ->
return if e.ctrlKey or e.altKey return if e.ctrlKey or e.altKey
char = g.char char = g.char
@ -1097,11 +1097,14 @@ threadHiding =
thread = e.target.parentNode.parentNode thread = e.target.parentNode.parentNode
threadHiding.hide thread threadHiding.hide thread
show: (e) -> show: (e) ->
div = e.target.parentNode thread = e.target.parentNode.parentNode
thread = div.parentNode
threadHiding.show thread threadHiding.show thread
$.remove div toggle: (thread) ->
if thread.className.indexOf('stub') != -1 or thread.style.display is 'none'
threadHiding.show thread
else
threadHiding.hide thread
hide: (thread) -> hide: (thread) ->
threadHiding.hideHide thread threadHiding.hideHide thread
@ -1138,6 +1141,7 @@ threadHiding =
$.hide thread.nextSibling $.hide thread.nextSibling
show: (thread) -> show: (thread) ->
$.remove $ 'div.block', thread
$.removeClass thread, 'stub' $.removeClass thread, 'stub'
$.show thread $.show thread
$.show thread.nextSibling $.show thread.nextSibling