right click to delete forks, no more trash

This commit is contained in:
George Hotz 2014-08-10 14:46:22 +00:00
parent d1e68d84fa
commit 043490efe2
3 changed files with 10 additions and 11 deletions

View File

@ -54,7 +54,6 @@ function register_drag_zoom() {
return clret;
}
function get_forknum(e) {
if (e.target.id == "trash") return -1;
var fn = e.target.id.split("vtimeline")[1];
if (fn == "box") return -1;
return parseInt(fn);
@ -70,15 +69,18 @@ function register_drag_zoom() {
downforknum = get_forknum(e);
return false;
});
$("#vtimelinebox").contextmenu(function(e) {
// right click to delete forks
forknum = get_forknum(e);
if (forknum != -1) {
stream.emit("deletefork", forknum);
redraw_flags();
}
return false;
});
$("#vtimelinebox").mouseup(function(e) {
p("mouseup");
if (e.button != 0) return;
if (e.target.id == "trash" && downforknum != -1) {
stream.emit("deletefork", downforknum);
redraw_flags();
return;
}
var up = get_clnum(e);
if (up === undefined) return;
var forknum = get_forknum(e);

View File

@ -4,9 +4,6 @@
<body>
<div id="vtimelinebox">
<!--<div class="vtimeline" id="vtimeline0"></div>
<div class="vtimeline" id="vtimeline1"></div>-->
<div id="trash">delete</div>
</div>
<div id="onlypanel">
<div id="controls">

View File

@ -1,7 +1,7 @@
(function(){
UI.body.contentParts.push(UI.Component.extend({render: (function() {
var self = this;
return [ HTML.Raw('<div id="vtimelinebox">\n<!--<div class="vtimeline" id="vtimeline0"></div>\n<div class="vtimeline" id="vtimeline1"></div>-->\n<div id="trash">delete</div>\n</div>\n'), HTML.DIV({
return [ HTML.Raw('<div id="vtimelinebox">\n</div>\n'), HTML.DIV({
id: "onlypanel"
}, "\n", HTML.DIV({
id: "controls"