From 4d640555ef1ba851f9e041c594d0dda7253e8450 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 2 Jan 2018 13:51:39 +0700 Subject: [ticket/15467] Fix JS for permissions setting PHPBB3-15467 --- phpBB/adm/style/permission_mask.html | 2 ++ phpBB/adm/style/permissions.js | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'phpBB/adm') diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index c556664b8c..23294d60df 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -9,6 +9,8 @@ var role_options = new Array(); + var no_role_assigned = "{LA_NO_ROLE_ASSIGNED}"; + {S_ROLE_JS_ARRAY} diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js index 9178adab50..4ae566ace7 100644 --- a/phpBB/adm/style/permissions.js +++ b/phpBB/adm/style/permissions.js @@ -279,6 +279,16 @@ function reset_role(id) { } t.options[0].selected = true; + + (function($)// Avoid conflicts with other libraries + { + var parent = $(t).parent(); + parent.find("span[title=Roles]")[0].innerText = no_role_assigned; + + // Find proper role value + var roleInput = parent.find('input[name^=role][data-name]'); + roleInput.val(0); + })(jQuery); // Avoid conflicts with other libraries } /** -- cgit v1.2.1 From 6b04fda0f323e7cfddab427c4f8696ac440d361c Mon Sep 17 00:00:00 2001 From: Nekstati <52348253+Nekstati@users.noreply.github.com> Date: Sun, 28 Jul 2019 18:39:04 +0700 Subject: [ticket/15467] Fix JS for permissions setting PHPBB3-15467 --- phpBB/adm/style/permissions.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js index 4ae566ace7..af8e21ad51 100644 --- a/phpBB/adm/style/permissions.js +++ b/phpBB/adm/style/permissions.js @@ -280,15 +280,9 @@ function reset_role(id) { t.options[0].selected = true; - (function($)// Avoid conflicts with other libraries - { - var parent = $(t).parent(); - parent.find("span[title=Roles]")[0].innerText = no_role_assigned; - - // Find proper role value - var roleInput = parent.find('input[name^=role][data-name]'); - roleInput.val(0); - })(jQuery); // Avoid conflicts with other libraries + var parent = t.parentNode; + parent.querySelector('span.dropdown-trigger').innerText = no_role_assigned; + parent.querySelector('input[data-name^=role]').value = '0'; } /** -- cgit v1.2.1