From 7db271e95ebab52c31c78f51270de71af1d750d2 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 3 Jan 2014 00:01:29 -0500 Subject: Add a shortcut to open the share div. The default shortcut is "s". --- p/scripts/main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index ef05eb2fb..43b0384e8 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -220,6 +220,13 @@ function collapse_entry() { $(".flux.current").toggleClass("active"); } +function auto_share() { + var share = $(".flux.current.active").find('.dropdown-target[id^="dropdown-share"]'); + if (share.length) { + window.location.replace('/i/#' + share.attr('id')); + } +} + function inMarkViewport(flux, box_to_follow, relative_follow) { var top = flux.position().top; if (relative_follow) { @@ -338,6 +345,11 @@ function init_shortcuts() { }, { 'disable_in_input': true }); + shortcut.add(shortcuts.auto_share, function () { + auto_share(); + }, { + 'disable_in_input': true + }); // Touches de navigation shortcut.add(shortcuts.prev_entry, prev_entry, { -- cgit v1.2.3