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:
parent
9927279cf2
commit
90e783e1fe
|
@ -321,12 +321,24 @@ wpList = {
|
||||||
},
|
},
|
||||||
|
|
||||||
process: function(el) {
|
process: function(el) {
|
||||||
var list = this;
|
var list = this,
|
||||||
$("[class^=add:" + list.id + ":]", el || null)
|
$el = $(el || document);
|
||||||
.filter('form').submit( function() { return list.wpList.add(this); } ).end()
|
|
||||||
.not('form').click( function() { return list.wpList.add(this); } );
|
$el.delegate( "form[class^=add:" + list.id + ":]", 'submit', function(){
|
||||||
$("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } );
|
return list.wpList.add(this);
|
||||||
$("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(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() {
|
recolor: function() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -106,7 +106,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20101004' );
|
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20101004' );
|
||||||
$scripts->add_data( 'autosave', 'group', 1 );
|
$scripts->add_data( 'autosave', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20091128' );
|
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20101119' );
|
||||||
$scripts->add_data( 'wp-lists', 'group', 1 );
|
$scripts->add_data( 'wp-lists', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.3');
|
$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.3');
|
||||||
|
|
Loading…
Reference in New Issue