UX: Align bulk select menu toggle relative to main wrapper when possible

This commit is contained in:
Kris 2020-03-26 19:15:33 -04:00 committed by GitHub
parent bed3f7f69a
commit 33350c31c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -1,9 +1,24 @@
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import showModal from "discourse/lib/show-modal";
export default Component.extend({
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: {
showBulkActions() {
const controller = showModal("topic-bulk-actions", {

View File

@ -188,13 +188,28 @@
}
}
.bulk-select-container {
@supports (position: sticky) {
@media screen and (min-width: 1250px) {
position: sticky;
position: -webkit-sticky;
}
}
}
#bulk-select {
position: fixed;
right: 20px;
top: 130px;
padding: 5px;
background-color: $secondary;
z-index: z("dropdown");
@supports (position: sticky) {
@media screen and (min-width: 1250px) {
position: absolute;
right: -60px;
top: 0;
}
}
}
button.dismiss-read {