aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-05-29 16:44:12 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-05-29 16:44:12 +0200
commitfc00447520d19ac2e0c6667f1c2cf5e7b41913a2 (patch)
tree00d81a27729fdbc7a8c351f804575c5a3fcf75e3 /phpBB/adm/style
parent467c794b9779412cf2cc29deb42c232168989486 (diff)
downloadforums-fc00447520d19ac2e0c6667f1c2cf5e7b41913a2.tar
forums-fc00447520d19ac2e0c6667f1c2cf5e7b41913a2.tar.gz
forums-fc00447520d19ac2e0c6667f1c2cf5e7b41913a2.tar.bz2
forums-fc00447520d19ac2e0c6667f1c2cf5e7b41913a2.tar.xz
forums-fc00447520d19ac2e0c6667f1c2cf5e7b41913a2.zip
[ticket/6466] Improve behavior of select and properly save role
PHPBB3-6466
Diffstat (limited to 'phpBB/adm/style')
-rw-r--r--phpBB/adm/style/permission_mask.html5
-rw-r--r--phpBB/adm/style/tooltip.js17
2 files changed, 18 insertions, 4 deletions
diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html
index 5aeafba476..7569867f8c 100644
--- a/phpBB/adm/style/permission_mask.html
+++ b/phpBB/adm/style/permission_mask.html
@@ -44,12 +44,13 @@
<div class="dropdown-container dropdown-button-control roles-options" data-alt-text="{LA_ROLE_DESCRIPTION}">
<span title="Roles" class="button icon-button tools-icon dropdown-trigger dropdown-select">{L_NO_ROLE_ASSIGNED}</span>
<div class="dropdown hidden">
- <ul class="dropdown-contents" id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">
+ <ul class="dropdown-contents" id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" >
{% for role in loops.role_options %}
- <li data-id="{{ role.ID }}" data-target-id="advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" data-title="{{ role.TITLE }}">{{ role.ROLE_NAME }}</li>
+ <li data-id="{{ role.ID }}" data-target-id="advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" data-title="{{ role.TITLE }}"{% if role.SELECTED == true %} data-selected="{{ role.SELECTED }}"{% endif %}>{{ role.ROLE_NAME }}</li>
{% endfor %}
</ul>
</div>
+ <input type="hidden" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" />
</div>
</dd>
<!-- ELSE -->
diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js
index ec170ef6b2..60222e51d5 100644
--- a/phpBB/adm/style/tooltip.js
+++ b/phpBB/adm/style/tooltip.js
@@ -198,7 +198,16 @@ $(function() {
// Prepare highlighting of select options and settings update
$options.each(function () {
- $(this).on('mouseover', function (e) {
+ var $this = $(this);
+ var $roles_options = $this.closest('.roles-options');
+
+ // Correctly show selected option
+ if (typeof $this.attr('data-selected') !== 'undefined') {
+ $this.closest('.roles-options').children('span').text($this.text());
+ $('')
+ }
+
+ $this.on('mouseover', function (e) {
var $this = $(this);
$options.removeClass('roles-highlight');
$this.addClass('roles-highlight');
@@ -210,7 +219,11 @@ $(function() {
init_colours($this.attr('data-target-id').replace('advanced', ''));
// Set selected setting
- $this.closest('.roles-options').children('span').text($this.text());
+ $roles_options.children('span').text($this.text());
+ $roles_options.children('input[type=hidden]').val($this.attr('data-id'));
+
+ // Trigger hiding of selection options
+ $('body').trigger('click');
});
});
});