Bläddra i källkod

HUE-2549 [core] Update checkbox check jQuery methods on jHueSelector

Updated checked methods
Fixed selectAll problems on list users and groups of useradmin
Enrico Berti 11 år sedan
förälder
incheckning
c9a25ed993

+ 2 - 2
apps/useradmin/src/useradmin/templates/list_groups.mako

@@ -161,11 +161,11 @@ ${layout.menubar(section='groups')}
 
     $("#selectAll").click(function () {
       if ($(this).attr("checked")) {
-        $(this).removeAttr("checked");
+        $(this).removeAttr("checked").removeClass("fa-check");
         $(".groupCheck").removeClass("fa-check").removeAttr("checked");
       }
       else {
-        $(this).attr("checked", "checked");
+        $(this).attr("checked", "checked").addClass("fa-check");
         $(".groupCheck").addClass("fa-check").attr("checked", "checked");
       }
       toggleActions();

+ 2 - 2
apps/useradmin/src/useradmin/templates/list_users.mako

@@ -190,11 +190,11 @@ ${layout.menubar(section='users')}
 
     $("#selectAll").click(function () {
       if ($(this).attr("checked")) {
-        $(this).removeAttr("checked");
+        $(this).removeAttr("checked").removeClass("fa-check");;
         $(".userCheck").removeClass("fa-check").removeAttr("checked");
       }
       else {
-        $(this).attr("checked", "checked");
+        $(this).attr("checked", "checked").addClass("fa-check");
         $(".userCheck").addClass("fa-check").attr("checked", "checked");
       }
       toggleActions();

+ 3 - 3
desktop/core/static/js/jquery.selector.js

@@ -113,16 +113,16 @@
           var isChecked = $(this).is(":checked");
           selectorContainer.find("input.selector:visible").each(function () {
             if (isChecked) {
-              $(this).attr("checked", "checked");
+              $(this).prop("checked", true);
               $(this).data("opt").attr("selected", "selected");
             }
             else {
-              $(this).removeAttr("checked");
+              $(this).prop("checked", false);
               $(this).data("opt").removeAttr("selected");
             }
           });
           if (searchBox.val() != "") {
-            $(this).removeAttr("checked");
+            $(this).prop("checked", false);
           }
           _this.options.onChange();
         }).prependTo(selectAll);