Permalink
Browse files

fix(notifications): use the correct way to check if checkbox is checked

fixes #9511
  • Loading branch information...
jdalsem committed Apr 14, 2016
1 parent c804e32 commit 4c7b8b653407b4f253ec53d31c830f4296429976
@@ -10,9 +10,9 @@
<script>
function setCollection(members, method, id) {
for ( var i in members ) {
var checked = $('#' + method + 'collections' + id).children("INPUT[type='checkbox']").attr('checked');
if ($("#"+method+members[i]).children("INPUT[type='checkbox']").attr('checked') != checked) {
$("#"+method+members[i]).children("INPUT[type='checkbox']").attr('checked', checked);
var checked = $('#' + method + 'collections' + id).children("INPUT[type='checkbox']").prop('checked');
if ($("#"+method+members[i]).children("INPUT[type='checkbox']").prop('checked') != checked) {
$("#"+method+members[i]).children("INPUT[type='checkbox']").prop('checked', checked);
functioncall = 'adjust' + method + '_alt("'+method+members[i]+'");';
eval(functioncall);
}
@@ -32,7 +32,7 @@ functioncall = 'adjust' + method + '_alt("'+method+members[i]+'");';
<tr>
<td>&nbsp;</td>
<?php
$i = 0;
$i = 0;
$NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
foreach($NOTIFICATION_HANDLERS as $method => $foo) {
if ($i > 0) {
@@ -2,7 +2,7 @@
$NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
?>
?>
<?php //@todo JS 1.8: no ?>
<script>
require(['jquery'], function($) {
@@ -19,7 +19,7 @@
?>
});
});
<?php
<?php
foreach($NOTIFICATION_HANDLERS as $method => $foo) {
?>
function adjust<?php echo $method; ?>(linkId) {
@@ -37,10 +37,10 @@ function adjust<?php echo $method; ?>_alt(linkId) {
if (obj.className == "<?php echo $method; ?>toggleOff") {
obj.className = "<?php echo $method; ?>toggleOn";
$('#' + linkId).children("input[type='checkbox']").attr('checked', true);
$('#' + linkId).children("input[type='checkbox']").prop('checked', true);
} else {
obj.className = "<?php echo $method; ?>toggleOff";
$('#' + linkId).children("input[type='checkbox']").attr('checked', false);
$('#' + linkId).children("input[type='checkbox']").prop('checked', false);
}
return false;
}

0 comments on commit 4c7b8b6

Please sign in to comment.