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':
break;
case 'w':
thread = nav.getThread()[0];
thread = nav.getThread();
return watcher.toggle(thread);
case 'x':
thread = nav.getThread();
threadHiding.toggle(thread);
}
}
};
@ -1436,11 +1438,16 @@
return threadHiding.hide(thread);
},
show: function(e) {
var div, thread;
div = e.target.parentNode;
thread = div.parentNode;
threadHiding.show(thread);
return $.remove(div);
var thread;
thread = e.target.parentNode.parentNode;
return threadHiding.show(thread);
}
},
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) {
@ -1480,6 +1487,7 @@
},
show: function(thread) {
var hiddenThreads, id;
$.remove($('div.block', thread));
$.removeClass(thread, 'stub');
$.show(thread);
$.show(thread.nextSibling);

View File

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