Explorar o código

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

Rudie Dirkx %!s(int64=9) %!d(string=hai) anos
pai
achega
44e67d9279
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/Packagist/WebBundle/Resources/public/js/search.js

+ 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;
         }