Skip to content

Commit 49da1ce

Browse files
SteveTheTechiemlh758
authored andcommitted
Eliminate deprecated jQuery API calls
Swapped out deprecated $().delegate() API calls for equivalent $().on() API calls.
1 parent 786ffc1 commit 49da1ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/jquery.multiselect.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
_bindMenuEvents: function() {
343343
var self = this;
344344
// optgroup label toggle support
345-
this.menu.delegate('.ui-multiselect-optgroup a', 'click.multiselect', function(e) {
345+
this.menu.on('click.multiselect', '.ui-multiselect-optgroup a', function(e) {
346346
e.preventDefault();
347347

348348
var $this = $(this);
@@ -367,13 +367,13 @@
367367
checked: nodes.length ? nodes[0].checked : null
368368
});
369369
})
370-
.delegate('label', 'mouseenter.multiselect', function() {
370+
.on('mouseenter.multiselect', 'label', function() {
371371
if(!$(this).hasClass('ui-state-disabled')) {
372372
self.labels.removeClass('ui-state-hover');
373373
$(this).addClass('ui-state-hover').find('input').focus();
374374
}
375375
})
376-
.delegate('label', 'keydown.multiselect', function(e) {
376+
.on('keydown.multiselect', 'label', function(e) {
377377
if(e.which === 82) {
378378
return; //"r" key, often used for reload.
379379
}
@@ -415,7 +415,7 @@
415415
break;
416416
}
417417
})
418-
.delegate('input[type="checkbox"], input[type="radio"]', 'click.multiselect', function(e) {
418+
.on('click.multiselect', 'input[type="checkbox"], input[type="radio"]', function(e) {
419419
var $this = $(this);
420420
var val = this.value;
421421
var optionText = $this.parent().find("span").text();
@@ -465,7 +465,7 @@
465465
_bindHeaderEvents: function() {
466466
var self = this;
467467
// header links
468-
this.header.delegate('a', 'click.multiselect', function(e) {
468+
this.header.on('click.multiselect', 'a', function(e) {
469469
var $this = $(this);
470470
if($this.hasClass('ui-multiselect-close')) {
471471
self.close();
@@ -475,7 +475,7 @@
475475
self.uncheckAll();
476476
}
477477
e.preventDefault();
478-
}).delegate('a', 'keydown.multiselect', function(e) {
478+
}).on('keydown.multiselect', 'a', function(e) {
479479
switch(e.which) {
480480
case 27:
481481
self.close();

0 commit comments

Comments
 (0)