update jquery attr into prop method for checked and disabled properties

This commit is contained in:
Florian BLOUET
2015-11-25 16:40:45 +01:00
parent 454f9d4db0
commit 5d2735cd0a
18 changed files with 78 additions and 73 deletions

View File

@@ -44,14 +44,21 @@ $(document).ready(function () {
$("ul.multiselect .coll-checkbox", $(this).closest('.form2')).attr("checked", false);
});
$(".multiselect-group").toggle(function () {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", true);
}, function () {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", false);
// toggle is deprecated:
var hasMultiSelectionGroup = false;
$(".multiselect-group").on('click', function () {
if( hasMultiSelectionGroup === true) {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", false);
hasMultiSelectionGroup = false;
} else {
var $this = $(this);
var groupId = $this.data('group-id');
$(".checkbox-" + groupId, $this.closest('.form2')).attr("checked", true);
hasMultiSelectionGroup = true;
}
});
});
//#############END DOCUMENT READY ######################################//