Pager: Prevent setting "all" value before initialization. See #1196

This commit is contained in:
Rob Garrison 2016-07-09 18:55:59 -05:00
parent e8b68272e2
commit 1846199b77
No known key found for this signature in database
GPG Key ID: 0A42D160D71978E1
4 changed files with 4 additions and 4 deletions

View File

@ -783,7 +783,7 @@
// set to either set or get value
parsePageSize = function( p, size, mode ) {
var s = parseInt( size, 10 ) || p.size || p.settings.size || 10;
return /all/i.test( size ) || s === p.totalRows ?
return p.initialized && (/all/i.test( size ) || s === p.totalRows) ?
// "get" to get `p.size` or "set" to set `p.$size.val()`
'all' : ( mode === 'get' ? s : p.size );
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1115,7 +1115,7 @@
parsePageSize: function( c, size, mode ) {
var p = c.pager,
s = parseInt( size, 10 ) || p.size || c.widgetOptions.pager_size || 10;
return /all/i.test( size ) || s === p.totalRows ?
return p.initialized && (/all/i.test( size ) || s === p.totalRows) ?
// "get" to set `p.size` or "set" to set `p.$size.val()`
'all' : ( mode === 'get' ? s : p.size );
},