diff options
| author | 2013-08-31 22:27:20 +0200 | |
|---|---|---|
| committer | 2013-08-31 22:27:20 +0200 | |
| commit | a9765af95cf512b76775750ca7e3e2163ca7b3f8 (patch) | |
| tree | cc2c3282c3303940b738c8a8bb4ad7b938e389c5 /app/views/javascript | |
| parent | 31a6a13268023a2db5eba2445ee6c7db4a6d9623 (diff) | |
Allow native control-click of article titles
Provide better access to the link of the article, and allow
control-click on the title to e.g. open in a background tab, without
having to reach the little link icon on the far right.
Diffstat (limited to 'app/views/javascript')
| -rw-r--r-- | app/views/javascript/main.phtml | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 24d66c1dc..0baab95b5 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -196,10 +196,15 @@ function init_posts () { var flux_header_toggle = $(".flux_header .item.title, .flux_header .item.date"); flux_header_toggle.unbind('click'); // évite d'associer 2 fois le toggle - flux_header_toggle.click (function () { + flux_header_toggle.click (function (e) { old_active = $(".flux.active"); new_active = $(this).parent ().parent (); - + if (e.target.tagName.toUpperCase() === 'A') { //Leave real links alone + <?php if ($mark['article'] == 'yes') { ?> + mark_read(new_active, true); + <?php } ?> + return true; + } toggleContent (new_active, old_active); }); @@ -221,6 +226,12 @@ function init_posts () { $(this).attr ('target', '_blank'); }); + $(".item.title>a").click (function (e) { + if (e.ctrlKey) return true; //Allow default control-click behaviour such as open in backround-tab + $(this).parent ().click (); //Will perform toggle flux_content + return false; + }); + <?php if ($mark['site'] == 'yes') { ?> $(".flux .link a").click (function () { mark_read($(this).parent().parent().parent(), true); |
