REFACTOR: Remove container from safari-hacks

This commit is contained in:
Robin Ward 2020-08-19 11:43:25 -04:00
parent c7c3fd4209
commit 89d766d089
2 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ export function autoLoadModules(container, registry) {
siteSettings: container.lookup("site-settings:main"),
themeSettings: container.lookup("service:theme-settings"),
keyValueStore: container.lookup("key-value-store:main"),
capabilities: container.lookup("capabilities:main"),
currentUser: container.lookup("current-user:main"),
site: container.lookup("site:main"),
session: container.lookup("session:main"),

View File

@ -5,6 +5,7 @@ import {
iOSWithVisualViewport
} from "discourse/lib/utilities";
import { INPUT_DELAY } from "discourse-common/config/environment";
import { helperContext } from "discourse-common/lib/helpers";
// TODO: remove calcHeight once iOS 13 adoption > 90%
// In iOS 13 and up we use visualViewport API to calculate height
@ -78,8 +79,7 @@ export function isWorkaroundActive() {
// per http://stackoverflow.com/questions/29001977/safari-in-ios8-is-scrolling-screen-when-fixed-elements-get-focus/29064810
function positioningWorkaround($fixedElement) {
const caps = Discourse.__container__.lookup("capabilities:main");
let caps = helperContext().capabilities;
if (!caps.isIOS || safariHacksDisabled()) {
return;
}