"Show Code" Window in editor won't scroll on big screens.
WyattTroy Christensen
Here is the video showing the problem:
And here is the code to fix it with userscripts:
// ==UserScript==
// @name ClickFunnels Editor Code Scroll Fix
// @namespace dawnation-clickfunnels-editor
// @version 1.0.0
// @description Fixes the fullscreen CodeMirror code window scrolling bug in the ClickFunnels editor on large monitors.
// @run-at document-idle
// @grant none
// ==/UserScript==
(function () {
var STYLE_ID = 'dn-cf-code-scroll-fix';
var HEIGHT_OFFSET = 72;
function injectFix(doc) {
if (!doc || !doc.head) return;
var style = doc.getElementById(STYLE_ID);
if (!style) {
style = doc.createElement('style');
style.id = STYLE_ID;
doc.head.appendChild(style);
}
style.textContent =
'.CodeMirror {' +
'height: calc(100vh - ' + HEIGHT_OFFSET + 'px) !important;' +
'max-height: calc(100vh - ' + HEIGHT_OFFSET + 'px) !important;' +
'}' +
'.CodeMirror-scroll {' +
'height: 100% !important;' +
'max-height: calc(100vh - ' + HEIGHT_OFFSET + 'px) !important;' +
'overflow: auto !important;' +
'}' +
'.CodeMirror-sizer {' +
'min-height: 100% !important;' +
'}';
doc.querySelectorAll('.CodeMirror').forEach(function (el) {
try {
if (el.CodeMirror && typeof el.CodeMirror.refresh === 'function') {
el.CodeMirror.refresh();
}
} catch (e) {}
});
}
function getDocs() {
var docs = [document];
document.querySelectorAll('iframe').forEach(function (frame) {
try {
if (frame.contentDocument) docs.push(frame.contentDocument);
} catch (e) {}
});
return docs;
}
function applyFix() {
getDocs().forEach(injectFix);
}
applyFix();
setInterval(applyFix, 1000);
window.addEventListener('resize', function () {
setTimeout(applyFix, 100);
});
})();