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

git-svn-id: http://svn.automattic.com/wordpress/trunk@17239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2011-01-07 20:52:42 +00:00
parent e7890765b7
commit 536564b8ff
4 changed files with 18 additions and 6 deletions

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');