FIX: simplifies and corrects new collection header tag/drop behaviour
This commit is contained in:
parent
ce687f334b
commit
ee8cda691d
|
@ -7,7 +7,7 @@
|
|||
category=secondCategory
|
||||
parentCategory=firstCategory
|
||||
categories=childCategories
|
||||
subCategory="true"
|
||||
subCategory=true
|
||||
noSubcategories=noSubcategories}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ export default ComboBoxComponent.extend({
|
|||
fullWidthOnMobile: true,
|
||||
caretDownIcon: "caret-right",
|
||||
caretUpIcon: "caret-down",
|
||||
subCategory: false,
|
||||
|
||||
init() {
|
||||
this._super();
|
||||
|
@ -50,11 +51,7 @@ export default ComboBoxComponent.extend({
|
|||
collectionHeader(allCategoriesUrl, allCategoriesLabel, noCategoriesUrl, noCategoriesLabel) {
|
||||
let shortcuts = "";
|
||||
|
||||
const currentRoute = Ember.getOwner(this)
|
||||
.lookup("controller:application")
|
||||
.get("currentRouteName");
|
||||
|
||||
if (currentRoute !== "discovery.parentCategory") {
|
||||
if (this.get("hasSelection") || (this.get("noSubcategories") && this.get("subCategory"))) {
|
||||
shortcuts += `
|
||||
<a href="${allCategoriesUrl}" class="category-filter">
|
||||
${allCategoriesLabel}
|
||||
|
@ -62,7 +59,7 @@ export default ComboBoxComponent.extend({
|
|||
`;
|
||||
}
|
||||
|
||||
if (this.get("subCategory") && currentRoute !== "discovery.categoryNone") {
|
||||
if (this.get("subCategory") && (this.get("hasSelection") || !this.get("noSubcategories"))) {
|
||||
shortcuts += `
|
||||
<a href="${noCategoriesUrl}" class="category-filter">
|
||||
${noCategoriesLabel}
|
||||
|
|
|
@ -79,10 +79,6 @@ export default ComboBoxComponent.extend({
|
|||
collectionHeader(allTagsUrl, allTagsLabel, noTagsUrl, noTagsLabel) {
|
||||
let content = "";
|
||||
|
||||
const currentRoute = Ember.getOwner(this)
|
||||
.lookup("controller:application")
|
||||
.get("currentRouteName");
|
||||
|
||||
if (this.get("tagId") !== "none") {
|
||||
content += `
|
||||
<a href="${noTagsUrl}" class="tag-filter">
|
||||
|
@ -91,7 +87,7 @@ export default ComboBoxComponent.extend({
|
|||
`;
|
||||
}
|
||||
|
||||
if (currentRoute === "tags.showCategory") {
|
||||
if (this.get("hasSelection") || this.get("tagId") === "none") {
|
||||
content += `
|
||||
<a href="${allTagsUrl}" class="tag-filter">
|
||||
${allTagsLabel}
|
||||
|
|
Loading…
Reference in New Issue