[Kimchi-devel] [PATCH] [Kimchi] Prevents pci passthrough double click

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Mon Aug 15 18:50:38 UTC 2016


 - Double clicks fire 'click' events twice, and this may confuse users
because the backend will throw an error about plugging the same adapter
twice. This commit prevents such events.

Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_edit_main.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index a59d51a..dcaafb8 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -536,6 +536,8 @@ kimchi.guest_edit_main = function() {
     var pciDeviceButtonHandler = function() {
         $('.btn.btn-link', '#form-guest-edit-pci').on('click', function(event) {
             event.preventDefault();
+            if (event.originalEvent.detail > 1)
+                return;
             var obj = $(this);
             var objIcon = obj.find('i');
             var id = obj.parent().parent().attr('id');
-- 
2.7.4




More information about the Kimchi-devel mailing list