Checks if maxItemsNumber is undefined.
This commit is contained in:
parent
a02f14ffbc
commit
9ecf899a86
|
@ -8,6 +8,9 @@ export default [
|
|||
attributes.imageSize = 'tainacan-medium';
|
||||
else
|
||||
attributes.imageSize = 'tainacan-medium-full';
|
||||
|
||||
if ( isNaN(attributes.maxItemsNumber) )
|
||||
attributes.maxItemsNumber = 12;
|
||||
|
||||
return attributes;
|
||||
},
|
||||
|
|
|
@ -281,7 +281,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
|
|||
if (maxItemsNumber != undefined && maxItemsNumber > 0)
|
||||
queryObject.perpage = maxItemsNumber;
|
||||
else if (queryObject.perpage != undefined && queryObject.perpage > 0)
|
||||
setAttributes({ maxItemsNumber: queryObject.perpage });
|
||||
setAttributes({ maxItemsNumber: Number(queryObject.perpage) });
|
||||
else {
|
||||
queryObject.perpage = 12;
|
||||
setAttributes({ maxItemsNumber: 12 });
|
||||
|
|
Loading…
Reference in New Issue