mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:34:26 +08:00
This reverts commit 5d77f485cb
.
There are some edge cases that we need to handle better. Reverting this
commit because we're going to do a beta release later today.
This commit is contained in:
parent
9df28fe4b3
commit
97519a3ea5
|
@ -1,7 +1,4 @@
|
||||||
import discourseComputed, {
|
import discourseComputed, { observes } from "discourse-common/utils/decorators";
|
||||||
bind,
|
|
||||||
observes,
|
|
||||||
} from "discourse-common/utils/decorators";
|
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
|
@ -61,11 +58,6 @@ export default Component.extend({
|
||||||
if (this.selected && this.selected.includes(this.topic)) {
|
if (this.selected && this.selected.includes(this.topic)) {
|
||||||
this.element.querySelector("input.bulk-select").checked = true;
|
this.element.querySelector("input.bulk-select").checked = true;
|
||||||
}
|
}
|
||||||
const title = this.element.querySelector(".main-link .title");
|
|
||||||
if (title) {
|
|
||||||
title.addEventListener("focus", this._onTitleFocus);
|
|
||||||
title.addEventListener("blur", this._onTitleBlur);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -106,11 +98,6 @@ export default Component.extend({
|
||||||
if (this.includeUnreadIndicator) {
|
if (this.includeUnreadIndicator) {
|
||||||
this.messageBus.unsubscribe(this.unreadIndicatorChannel);
|
this.messageBus.unsubscribe(this.unreadIndicatorChannel);
|
||||||
}
|
}
|
||||||
const title = this.element?.querySelector(".main-link .title");
|
|
||||||
if (title) {
|
|
||||||
title.removeEventListener("focus", this._onTitleFocus);
|
|
||||||
title.removeEventListener("blur", this._onTitleBlur);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("topic.id")
|
@discourseComputed("topic.id")
|
||||||
|
@ -272,15 +259,12 @@ export default Component.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.element.classList.add("highlighted");
|
const $topic = $(this.element);
|
||||||
this.element.setAttribute(
|
$topic
|
||||||
"data-islastviewedtopic",
|
.addClass("highlighted")
|
||||||
opts.isLastViewedTopic
|
.attr("data-islastviewedtopic", opts.isLastViewedTopic);
|
||||||
);
|
|
||||||
this.element.addEventListener("animationend", () => {
|
$topic.on("animationend", () => $topic.removeClass("highlighted"));
|
||||||
this.element.classList.remove("highlighted");
|
|
||||||
});
|
|
||||||
this.element.querySelector(".main-link .title").focus();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -295,20 +279,4 @@ export default Component.extend({
|
||||||
this.highlight();
|
this.highlight();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@bind
|
|
||||||
_onTitleFocus() {
|
|
||||||
if (this.element && !this.isDestroying && !this.isDestroyed) {
|
|
||||||
const mainLink = this.element.querySelector(".main-link");
|
|
||||||
mainLink.classList.add("focused");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
@bind
|
|
||||||
_onTitleBlur() {
|
|
||||||
if (this.element && !this.isDestroying && !this.isDestroyed) {
|
|
||||||
const mainLink = this.element.querySelector(".main-link");
|
|
||||||
mainLink.classList.remove("focused");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -234,15 +234,6 @@
|
||||||
.raw-topic-link > * {
|
.raw-topic-link > * {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.focused {
|
|
||||||
box-shadow: inset 3px 0 0 var(--tertiary);
|
|
||||||
}
|
|
||||||
/* we have a custom focus indicator so we can remove the native one */
|
|
||||||
.title:focus,
|
|
||||||
.title:focus-visible {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.unread-indicator {
|
.unread-indicator {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user