Page 1 of 1

[Patch] Make "open in new tab" hotkey work on mac too in non-expanded mode

Posted: 07 Feb 2016, 20:35
by koskokos
If will do "ctrl+click" on windows in list of non-expanded articles it will work fine, but on mac to do the same you need to hit "cmd+click" instead of "ctrl+click" and my patch adds needed check into handlers.

Code: Select all

diff --git a/js/viewfeed.js b/js/viewfeed.js
index 181a932..48006f3 100755
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -1755,7 +1755,7 @@ function cdmClicked(event, id) {
        try {
                //var shift_key = event.shiftKey;

-               if (!event.ctrlKey) {
+               if (!event.ctrlKey && !event.metaKey) {

                        if (!getInitParam("cdm_expanded")) {
                                return cdmExpandArticle(id);
@@ -1824,7 +1824,7 @@ function hlClicked(event, id) {
                if (event.which == 2) {
                        view(id);
                        return true;
-               } else if (event.ctrlKey) {
+               } else if (event.ctrlKey || event.metaKey) {
                        toggleSelected(id, true);
                        toggleUnread(id, 0, false);
                        openArticleInNewWindow(id);

Re: [Patch] Make "open in new tab" hotkey work on mac too in non-expanded mode

Posted: 07 Feb 2016, 20:52
by fox
OK but as a merge request please

Re: [Patch] Make "open in new tab" hotkey work on mac too in non-expanded mode

Posted: 07 Feb 2016, 21:53
by koskokos
I would be happy to create merge request but for now I can't push new branch.