Fixes sorting select not showing core title label when loading from URL

This commit is contained in:
Mateus Machado Luna 2019-02-21 16:27:19 -03:00
parent 424895ff1c
commit aedc301ce2
2 changed files with 16 additions and 9 deletions

View File

@ -893,10 +893,13 @@
if (this.getOrderByName() != null && this.getOrderByName() != undefined && this.getOrderByName() != '') { if (this.getOrderByName() != null && this.getOrderByName() != undefined && this.getOrderByName() != '') {
return this.getOrderByName(); return this.getOrderByName();
} else { } else {
for (let metadatum of this.sortingMetadata) { for (let metadatum of this.sortingMetadata) {
if ( if (
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date') && this.orderBy == 'date') || ((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date') && this.orderBy == metadatum.slug) || ((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && metadatum.metadata_type_object.core) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == metadatum.slug) ||
((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id) ((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id)
) )
return metadatum.name; return metadatum.name;
@ -1679,6 +1682,7 @@
font-weight: normal; font-weight: normal;
margin-top: 3px; margin-top: 3px;
margin-bottom: 2px; margin-bottom: 2px;
cursor: default;
} }
.button { .button {

View File

@ -860,12 +860,14 @@
return this.getOrderByName(); return this.getOrderByName();
} else { } else {
for (let metadatum of this.sortingMetadata) { for (let metadatum of this.sortingMetadata) {
if ( if (
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num') && this.orderBy == metadatum.slug) || ((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && metadatum.metadata_type_object.core) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == metadatum.slug) ||
((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id) ((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id)
) )
return metadatum.name; return metadatum.name;
} }
} }
} }
@ -1630,6 +1632,7 @@
font-weight: normal; font-weight: normal;
margin-top: 3px; margin-top: 3px;
margin-bottom: 2px; margin-bottom: 2px;
cursor: default;
} }
.button { .button {