fixing a bug in the checkbox filter list for custom fields. the key was getting delet...
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 27 Mar 2019 17:39:58 +0000 (13:39 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 27 Mar 2019 17:39:58 +0000 (13:39 -0400)
js/memberManagement.js
views/admin/manageDashboard/index.html
views/admin/member/memberInfo.html

index a87f7f2..c128ba7 100644 (file)
@@ -187,7 +187,6 @@ window.Glma = (function() {
 
     var confirmAction = function(modal){
         //$('#confirmation-modal')[0] $("#glm-modal-overlay");
-        console.log(modal.container)
         var instance = M.Modal.getInstance(modal.container);
         instance.open();
         $(document).on("click", ".modal-close", function(){
@@ -241,7 +240,6 @@ window.Glma = (function() {
         * 
         */
         textSearch: function(textSearchData){
-            console.log(jQuery('input#'+textSearchData.slug+'-text'));
             var searchResults   = {};
             var listData = {
                 action      : 'glm_members_admin_ajax',
index f3c6e5a..9c58c22 100644 (file)
                     member          : target.attr("data-member")        || null,
                     option          : target.attr('data-option')        || null,
                     view            : target.attr('data-view')          || null,
+                    
                     mergingObjects  : [actionData] 
                 });
                 window.Glma.startTransition({
                         listData['categorySearch'] = "";
                     }
                 }
+
                 if( type == "checkbox"){
                     selected = target.prop('checked');
-                    if(selected && type == "checkbox" ){
+                    if (typeof target.data("customfield") !== "undefined" && selected){
+                        listData[target.attr("name")] = 'true';
+                        var name = target.attr("name");
+
+                        listData[name] = "true";
+                    }else{
+                        // delete listData[target.attr("name")] ;
+                    }
+                  
+                    if(selected && type == "checkbox" && typeof target.data("customfield") == "undefined" ){
                         listData[searchType] = 'true';
                         {literal} target.parent().css({color: "#26A69A"}) {/literal}
-                    }else{
+                    }else if(selected && type != "checkbox" && typeof target.data("customfield") == "undefined"){
                         delete listData[searchType];
                         {literal} target.parent().css({color: "#9E9E9E"}) {/literal}
                     }
+        
                 }
 
                 window.Glma.manageMember(
index 66c6206..3d0431c 100755 (executable)
@@ -5,7 +5,14 @@
     <!--[if lt IE 9]>
       <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
     <![endif]-->
-
+    <style>
+            #glm-members-custom-fields-glm-member-db [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
+                position: static !important;
+                left: 0px !important;
+                opacity: 1 !important;
+                pointer-events: stroke !important;
+            }
+        </style>
 {if apply_filters('glm_members_permit_admin_member_info_edit', true)}
     {if $memberInfoID && $memberInfo}
         <!--  Delete Member Profile dialog -->