mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 15:47:05 +00:00
Use event delegation in wp-lists.js. Fixes #15488
git-svn-id: https://develop.svn.wordpress.org/trunk@16486 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -321,12 +321,24 @@ wpList = {
|
||||
},
|
||||
|
||||
process: function(el) {
|
||||
var list = this;
|
||||
$("[class^=add:" + list.id + ":]", el || null)
|
||||
.filter('form').submit( function() { return list.wpList.add(this); } ).end()
|
||||
.not('form').click( function() { return list.wpList.add(this); } );
|
||||
$("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } );
|
||||
$("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } );
|
||||
var list = this,
|
||||
$el = $(el || document);
|
||||
|
||||
$el.delegate( "form[class^=add:" + list.id + ":]", 'submit', function(){
|
||||
return list.wpList.add(this);
|
||||
});
|
||||
|
||||
$el.delegate( "[class^=add:" + list.id + ":]:not(form)", 'click', function(){
|
||||
return list.wpList.add(this);
|
||||
});
|
||||
|
||||
$el.delegate( "[class^=delete:" + list.id + ":]", 'click', function(){
|
||||
return list.wpList.del(this);
|
||||
});
|
||||
|
||||
$el.delegate( "[class^=dim:" + list.id + ":]", 'click', function(){
|
||||
return list.wpList.dim(this);
|
||||
});
|
||||
},
|
||||
|
||||
recolor: function() {
|
||||
|
||||
Reference in New Issue
Block a user