浏览代码

Fix buttons not working for dynamically added services

O2 Graphics 4 年之前
父节点
当前提交
c857e8037e
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      tarteaucitron.js

+ 8 - 0
tarteaucitron.js

@@ -715,6 +715,14 @@ var tarteaucitron = {
             tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none');
 
             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);