From da768d6cf42028674e2fb72ff4b726cd12b6faf6 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Wed, 18 Aug 2010 22:45:29 +0400 Subject: [PATCH] + mouse over tag of task with Ctrl (Cmd) pressed will shade the tasks with selected tag --- src/mytinytodo.js | 7 +++++-- src/themes/default/style.css | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mytinytodo.js b/src/mytinytodo.js index c69dea8..53be47a 100644 --- a/src/mytinytodo.js +++ b/src/mytinytodo.js @@ -302,10 +302,13 @@ var mytinytodo = window.mytinytodo = _mtt = { $('#tasklist .tag').live('mouseover mouseout', function(event){ var cl = 'tag-id-' + $(this).attr('tagid'); - if(event.type == 'mouseover') _mtt.timers.previewtag = setTimeout( function(){$('#tasklist li:not(.'+cl+')').addClass('not-preview-tag');}, 500); + var sel = (event.metaKey || event.ctrlKey) ? 'li.'+cl : 'li:not(.'+cl+')'; + if(event.type == 'mouseover') { + _mtt.timers.previewtag = setTimeout( function(){$('#tasklist '+sel).addClass('not-in-tagpreview');}, 700); + } else { clearTimeout(_mtt.timers.previewtag); - $('#tasklist li:not(.'+cl+')').removeClass('not-preview-tag'); + $('#tasklist li').removeClass('not-in-tagpreview'); } }); diff --git a/src/themes/default/style.css b/src/themes/default/style.css index 7990b01..ac1352d 100644 --- a/src/themes/default/style.css +++ b/src/themes/default/style.css @@ -169,7 +169,7 @@ li.task-completed .task-title a { color:#777777; } #tasklist li.task-completed .duedate { color:#777777; border-color:#777777; } li.task-completed { opacity:0.8; } li.task-completed .task-toggle { opacity:0.8; } -li.not-preview-tag { opacity:0.1; } +li.not-in-tagpreview { opacity:0.1; } a.taskactionbtn { display:block; float:right; height:15px; width:15px; text-decoration:none; background:url(images/icons.gif) 0 0 no-repeat; } li:hover a.taskactionbtn, a.taskactionbtn.mtt-menu-button-active { background-position:-16px 0; }