Selectively reset list-table forms rather than all forms to avoid stompage. Props koopersmith. fixes #16098

git-svn-id: https://develop.svn.wordpress.org/trunk@17239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-01-07 20:52:42 +00:00
parent d1575abd76
commit d95ed80091
4 changed files with 18 additions and 6 deletions
+15 -3
View File
@@ -5,9 +5,7 @@ window.listTable = {
init: function() {
this.loading = false;
$('form').each(function() {
this.reset();
});
this.reset( '.tablenav, .search-box, .wp-list-table' );
if ( '' == $.query.GET('paged') )
$.query.SET('paged', 1);
@@ -16,6 +14,20 @@ window.listTable = {
this.$tbody = $('#the-list, #the-comment-list');
},
reset: function( context ) {
context = $( context );
$('input', context).each( function(){
this.value = this.defaultValue;
this.checked = this.defaultChecked;
});
$('option', context).each( function(){
this.selected = this.defaultSelected;
});
$('textarea', context).each( function(){
this.value = this.defaultValue;
});
},
// paging
set_total_pages: function(num) {
var last_page_url = $('.last-page').attr('href');