Browse Source

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

Rudie Dirkx 9 năm trước cách đây
mục cha
commit
44e67d9279
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  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;
         }