mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 03:03:17 +08:00
DEV: Use .ember-application
instead of #main
`#main` in the test environment is replaced with `#ember-testing`, so this code would break. It never did only because we don't test these code paths 👀
This commit is contained in:
parent
349f6e18f3
commit
4ca6717994
|
@ -177,7 +177,7 @@ const SiteHeaderComponent = MountWidget.extend(
|
||||||
this.docAt = header.offsetTop;
|
this.docAt = header.offsetTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
const main = document.querySelector("#main");
|
const main = document.querySelector(".ember-application");
|
||||||
const offsetTop = main ? main.offsetTop : 0;
|
const offsetTop = main ? main.offsetTop : 0;
|
||||||
const offset = window.pageYOffset - offsetTop;
|
const offset = window.pageYOffset - offsetTop;
|
||||||
if (offset >= this.docAt) {
|
if (offset >= this.docAt) {
|
||||||
|
|
|
@ -19,7 +19,9 @@ const ScrollingDOMMethods = {
|
||||||
},
|
},
|
||||||
|
|
||||||
screenNotFull() {
|
screenNotFull() {
|
||||||
return window.height > document.querySelector("#main").offsetHeight;
|
return (
|
||||||
|
window.height > document.querySelector(".ember-application").offsetHeight
|
||||||
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -334,8 +334,9 @@ export default createWidget("topic-admin-menu", {
|
||||||
|
|
||||||
if (attrs.openUpwards) {
|
if (attrs.openUpwards) {
|
||||||
const documentHeight = $(document).height();
|
const documentHeight = $(document).height();
|
||||||
const mainHeight = $("#main").height();
|
const mainHeight = $(".ember-application").height();
|
||||||
let bottom = documentHeight - top - 70 - $("#main").offset().top;
|
let bottom =
|
||||||
|
documentHeight - top - 70 - $(".ember-application").offset().top;
|
||||||
|
|
||||||
if (documentHeight > mainHeight) {
|
if (documentHeight > mainHeight) {
|
||||||
bottom = bottom - (documentHeight - mainHeight) - outerHeight;
|
bottom = bottom - (documentHeight - mainHeight) - outerHeight;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user