briancwald / material_admin

Drupal 8 Admin Theme
GNU General Public License v2.0
48 stars 15 forks source link

Permissions page: Checkboxes are disabled #15

Closed e0ipso closed 7 years ago

e0ipso commented 7 years ago

They are incorrectly disabled:

Seven

edit role contenta json api 2017-06-21 00-39-05

Material Admin

edit role contenta json api 2017-06-21 00-40-03

briancwald commented 7 years ago

oh man. OK I see a ton of "dummy-checkbox" checkboxes that get added to the Core Permissions javascript library due to it 'inherited' logic, which is confusing material design checkboxes. This may take some sorting out. meanwhile, it may just make sense to roll back browser default for this page. I will investigate.

e0ipso commented 7 years ago

@briancwald thanks for taking a look.

briancwald commented 7 years ago

@e0ipso can you try out the permissions-checkboxes branch? It's definitely NOT an ideal solution and the code needs to be cleaned up but I think logically it should work. Just curious if it at least solves the problem of disabling checkboxes that shouldn't be.

Essentially replaces the core user/user.permissions.js library and replaces some markup to use the label instead of the checkboxes.

@mortenson I think this makes sense logically (as logical as the original code, at least) but if you get a minute, can you see if there is a better way of doing what I did here?

mortenson commented 7 years ago

@briancwald It's hard to see what you changed in that branch, but overriding the entire behavior makes sense in this case.

briancwald commented 7 years ago
45c45
<         var $dummy = $('<span class="dummy-checkbox js-dummy-checkbox" ><input type="checkbox" checked="checked" disabled="disabled" /><label class="visually-hidden">disabled</label></span>')
---
>         var $dummy = $('<input type="checkbox" class="dummy-checkbox js-dummy-checkbox" disabled="disabled" checked="checked" />')
53c53
<           .before($dummy);
---
>           .after($dummy);
60c60
<           .each(self.toggle)
---
>           .each(self.toggle);
81,85d80
<         if (authCheckbox.checked) {
<           $(this).siblings('label').css('display','none');
<         } else {
<           $(this).siblings('label').css('display','');
<         }
mortenson commented 7 years ago

This should be fixed now.

e0ipso commented 7 years ago

👏