UX: Align bulk select menu toggle relative to main wrapper when possible
This commit is contained in:
parent
bed3f7f69a
commit
33350c31c0
|
@ -1,9 +1,24 @@
|
||||||
|
import { schedule } from "@ember/runloop";
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
classNames: ["bulk-select-container"],
|
classNames: ["bulk-select-container"],
|
||||||
|
|
||||||
|
didInsertElement() {
|
||||||
|
this._super(...arguments);
|
||||||
|
|
||||||
|
schedule("afterRender", () => {
|
||||||
|
let mainOutletPadding =
|
||||||
|
window.getComputedStyle(document.querySelector("#main-outlet"))
|
||||||
|
.paddingTop || 0;
|
||||||
|
|
||||||
|
document.querySelector(
|
||||||
|
".bulk-select-container"
|
||||||
|
).style.top = mainOutletPadding;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
showBulkActions() {
|
showBulkActions() {
|
||||||
const controller = showModal("topic-bulk-actions", {
|
const controller = showModal("topic-bulk-actions", {
|
||||||
|
|
|
@ -188,13 +188,28 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bulk-select-container {
|
||||||
|
@supports (position: sticky) {
|
||||||
|
@media screen and (min-width: 1250px) {
|
||||||
|
position: sticky;
|
||||||
|
position: -webkit-sticky;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#bulk-select {
|
#bulk-select {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
top: 130px;
|
top: 130px;
|
||||||
padding: 5px;
|
|
||||||
background-color: $secondary;
|
background-color: $secondary;
|
||||||
z-index: z("dropdown");
|
z-index: z("dropdown");
|
||||||
|
@supports (position: sticky) {
|
||||||
|
@media screen and (min-width: 1250px) {
|
||||||
|
position: absolute;
|
||||||
|
right: -60px;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.dismiss-read {
|
button.dismiss-read {
|
||||||
|
|
Loading…
Reference in New Issue