Skip to content

Commit

Permalink
replace custom polyfill by a supported one
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed May 3, 2022
1 parent bf89c6d commit 11a3518
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 117 deletions.
104 changes: 0 additions & 104 deletions app/assets/javascripts/polyfills.js

This file was deleted.

18 changes: 8 additions & 10 deletions app/assets/javascripts/pythia_submission.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals fullScreenApi */
import fscreen from "fscreen";
import { showInfoModal } from "./modal.js";

function initPythiaSubmissionShow(submissionCode, activityPath) {
Expand Down Expand Up @@ -108,23 +108,23 @@ function initPythiaSubmissionShow(submissionCode, activityPath) {
}

function initFullScreen() {
$(document).bind(fullScreenApi.fullScreenEventName, resizeFullScreen);
fscreen.addEventListener("fullscreenchange", resizeFullScreen);

$("#tutor #fullscreen-button").on("click", function () {
const elem = $("#tutor").get(0);
if (fullScreenApi.isFullScreen()) {
if (fscreen.fullscreenElement) {
$("#tutor .modal-dialog").removeClass("modal-fullscreen");
fullScreenApi.cancelFullScreen(elem);
fscreen.exitFullscreen(elem);
} else {
$("#tutor .modal-dialog").addClass("modal-fullscreen");
fullScreenApi.requestFullScreen(elem);
fscreen.requestFullscreen(elem);
}
});
}

function resizeFullScreen() {
const $tutor = $("#tutor");
if (!fullScreenApi.isFullScreen()) {
if (!fscreen.fullscreenElement) {
$tutor.removeClass("fullscreen");
$("#tutorviz").height($("#tutorviz").data("standardheight"));
} else {
Expand Down Expand Up @@ -198,11 +198,9 @@ function initPythiaSubmissionShow(submissionCode, activityPath) {
});

modal.on("hidden.bs.modal", function () {
if (fullScreenApi.isFullScreen()) {
const $tutor = $("#tutor");
const elem = $tutor.get(0);
if (fscreen.fullscreenElement) {
$("#tutor .modal-dialog").removeClass("modal-fullscreen");
fullScreenApi.cancelFullScreen(elem);
fscreen.exitFullscreen();
}
});
};
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/packs/application_pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import { Alert, Button, Collapse, Dropdown, Modal, Popover, Tab, Tooltip } from
const bootstrap = { Alert, Button, Collapse, Dropdown, Modal, Popover, Tab, Tooltip };
window.bootstrap = bootstrap;

import "polyfills.js";

import { Drawer } from "drawer";
import { Toast } from "toast";
import { Notification } from "notification";
Expand Down
1 change: 0 additions & 1 deletion app/javascript/packs/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Alert, Button, Collapse, Dropdown, Modal, Popover, Tab, Tooltip } from
const bootstrap = { Alert, Button, Collapse, Dropdown, Modal, Popover, Tab, Tooltip };
window.bootstrap = bootstrap;

import "polyfills.js";
import { initTooltips } from "util.js";
import { initClipboard } from "copy";

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"dragula": "^3.7.3",
"first-input-delay": "^0.1.3",
"flatpickr": "^4.6.13",
"fscreen": "^1.2.0",
"glightbox": "^3.2.0",
"glob": "^8.0.1",
"iframe-resizer": "^4.3.2",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3737,6 +3737,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=

fscreen@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fscreen/-/fscreen-1.2.0.tgz#1a8c88e06bc16a07b473ad96196fb06d6657f59e"
integrity sha512-hlq4+BU0hlPmwsFjwGGzZ+OZ9N/wq9Ljg/sq3pX+2CD7hrJsX9tJgWWK/wiNTFM212CLHWhicOoqwXyZGGetJg==

fsevents@^2.1.2, fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
Expand Down

0 comments on commit 11a3518

Please sign in to comment.