mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Add new sort everywhere needed, update API docs
This commit is contained in:
parent
4d6a272795
commit
f9360b8ade
6 changed files with 24 additions and 48 deletions
|
@ -68,7 +68,7 @@ import ChevronLeftIcon from 'primevue/icons/chevronleft';
|
|||
import ChevronRightIcon from 'primevue/icons/chevronright';
|
||||
import ChevronUpIcon from 'primevue/icons/chevronup';
|
||||
import Ripple from 'primevue/ripple';
|
||||
import { DomHandler } from 'primevue/utils';
|
||||
import { DomHandler, ObjectUtils } from 'primevue/utils';
|
||||
|
||||
export default {
|
||||
name: 'GalleriaThumbnails',
|
||||
|
@ -443,15 +443,8 @@ export default {
|
|||
this.sortedResponsiveOptions.sort((data1, data2) => {
|
||||
const value1 = data1.breakpoint;
|
||||
const value2 = data2.breakpoint;
|
||||
let result = null;
|
||||
|
||||
if (value1 == null && value2 != null) result = -1;
|
||||
else if (value1 != null && value2 == null) result = 1;
|
||||
else if (value1 == null && value2 == null) result = 0;
|
||||
else if (typeof value1 === 'string' && typeof value2 === 'string') result = comparer(value1, value2);
|
||||
else result = value1 < value2 ? -1 : value1 > value2 ? 1 : 0;
|
||||
|
||||
return -1 * result;
|
||||
return ObjectUtils.sort(value1, value2, -1, comparer);
|
||||
});
|
||||
|
||||
for (let i = 0; i < this.sortedResponsiveOptions.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue