MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / beforeRender

Function beforeRender

src/lib/applySettings.js:9–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8export default {
9 beforeRender() {
10 //animation
11 appSettings.applyAnimationSetting();
12
13 //full-screen
14 if (appSettings.value.fullscreen) {
15 acode.exec("enable-fullscreen");
16 }
17
18 //setup vibration
19 app.addEventListener("click", function (e) {
20 const $target = e.target;
21 if ($target.hasAttribute("vibrate") && appSettings.value.vibrateOnTap) {
22 navigator.vibrate(config.VIBRATION_TIME);
23 }
24 });
25
26 system.setInputType(appSettings.value.keyboardMode);
27 appSettings.applyUiZoomSetting();
28 // Keep native context menu enabled globally; editor manager scopes disabling to CodeMirror focus.
29 system.setNativeContextMenuDisabled(false);
30 },
31 afterRender() {
32 const { value: settings } = appSettings;
33 const { $toggler } = quickTools;

Callers

nothing calls this directly

Calls 5

applyAnimationSettingMethod · 0.80
setInputTypeMethod · 0.80
applyUiZoomSettingMethod · 0.80
execMethod · 0.65

Tested by

no test coverage detected