Browse Source

Merge pull request #514 from O2Graphics/master

Fix buttons not working for dynamically added services
Amauri CHAMPEAUX 4 năm trước cách đây
mục cha
commit
1846f2c436
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      tarteaucitron.js

+ 8 - 0
tarteaucitron.js

@@ -715,6 +715,14 @@ var tarteaucitron = {
             tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
             tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
 
 
             tarteaucitron.userInterface.order(service.type);
             tarteaucitron.userInterface.order(service.type);
+
+            tarteaucitron.addClickEventToId(service.key + 'Allowed', function () {
+                tarteaucitron.userInterface.respond(this, true);
+            });
+
+            tarteaucitron.addClickEventToId(service.key + 'Denied', function () {
+                tarteaucitron.userInterface.respond(this, false);
+            });
         }
         }
 
 
         tarteaucitron.pro('!' + service.key + '=' + isAllowed);
         tarteaucitron.pro('!' + service.key + '=' + isAllowed);