Skip to content

Commit

Permalink
not a good idea to use 'this' inside 'sendPermissions', use
Browse files Browse the repository at this point in the history
'event.target' instead
  • Loading branch information
okonomiyaki3000 committed Nov 21, 2016
1 parent 58aadb2 commit 04d2903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions media/system/js/permissions-uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function sendPermissions(event) {
'use strict';

// set the icon while storing the values
var icon = document.getElementById('icon_' + this.id);
var icon = document.getElementById('icon_' + event.target.id);
icon.removeAttribute('class');
icon.setAttribute('style', 'background: url(../media/system/images/modal/spinner.gif); display: inline-block; width: 16px; height: 16px');

Expand All @@ -16,7 +16,7 @@ function sendPermissions(event) {
var option = getUrlParam('option');
var view = getUrlParam('view');
var title = component;
var value = this.value;
var value = event.target.value;

if (option == 'com_config' && component == false && extension == false)
{
Expand All @@ -34,7 +34,7 @@ function sendPermissions(event) {
title = document.getElementById('jform_title').value;
}

var id = this.id.replace('jform_rules_', '');
var id = event.target.id.replace('jform_rules_', '');
var lastUnderscoreIndex = id.lastIndexOf('_');

var permission_data = {
Expand Down
2 changes: 1 addition & 1 deletion media/system/js/permissions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 04d2903

Please sign in to comment.