Prechádzať zdrojové kódy

#656 Ctrl + Enter to open search result in new tab

Rudie Dirkx 9 rokov pred
rodič
commit
44e67d9279

+ 7 - 1
src/Packagist/WebBundle/Resources/public/js/search.js

@@ -129,7 +129,13 @@
         }
 
         if (keymap.enter === event.which && currentSelected.data('url')) {
-            window.location = currentSelected.data('url');
+            var url = currentSelected.data('url');
+            if (event.ctrlKey) {
+                window.open(url);
+                return;
+            }
+
+            window.location = url;
             return;
         }