DEV: Move popups left if application.hbs wrapper is moved by theme

We have a div that is inside #main because of the history of Ember explained here. Once we have Ember cli, we can use optional feature flags and disable creating this div with application-template-wrapper: false, and refactor this code and any plugins that rely on that div being present (some plugin regarding remote collaboration??).
This commit is contained in:
Mark VanLandingham 2020-11-06 09:46:26 -06:00 committed by GitHub
parent 0863c36221
commit 95c871be3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -69,7 +69,10 @@ export default Component.extend({
}
const shareLinkWidth = $this.width();
let x = $currentTargetOffset.left - shareLinkWidth / 2;
const pageLeftOffset = document.querySelector(
".ember-application > .ember-view"
).offsetLeft;
let x = $currentTargetOffset.left - pageLeftOffset - shareLinkWidth / 2;
if (x < 25) {
x = 25;
}

View File

@ -201,7 +201,10 @@ export default Mixin.create({
}
} else {
// The site direction is ltr
position.left += target.width() + 10;
const pageLeftOffset = document.querySelector(
".ember-application > .ember-view"
).offsetLeft;
position.left += target.width() - pageLeftOffset + 10;
let overage = $(window).width() - 50 - (position.left + width);
if (overage < 0) {