Skip to content
This repository was archived by the owner on Apr 12, 2020. It is now read-only.
/ git-bundle Public archive

Commit d4e83cf

Browse files
author
alexandresalome
committed
compatible with jQuery 1.9.0
1 parent 17ccd19 commit d4e83cf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

Resources/public/js/commit.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* Detects changes on single-file checkbox.
33
*/
4-
$(document).on('change', 'ul.diff-summary input[type=checkbox]', function (event) {
5-
$t = $(event.currentTarget);
6-
$target = $("#" + $t.attr('data-file-id'));
4+
$(document).on('change', 'ul.diff-summary input[type=checkbox][data-file-id]', function (event) {
5+
var $t = $(event.currentTarget);
6+
var $target = $("#" + $t.attr('data-file-id'));
77

8-
if (undefined == $t.attr('checked')) {
9-
$target.hide();
10-
} else {
8+
if ($t.prop('checked')) {
119
$target.show();
10+
} else {
11+
$target.hide();
1212
}
1313
});
1414

@@ -19,10 +19,6 @@ $(document).on('change', 'input[type=checkbox].diff-toggle-all', function (event
1919
var $t = $(event.currentTarget);
2020
var $target = $("#" + $t.attr('data-target') + " input[type=checkbox][data-file-id]");
2121

22-
if (undefined == $t.attr('checked')) {
23-
$target.removeAttr('checked');
24-
} else {
25-
$target.attr('checked', 'checked');
26-
}
22+
$target.prop('checked', $t.prop('checked'));
2723
$target.trigger('change');
2824
});

0 commit comments

Comments
 (0)