Don't use css calc with vw as it fails on Chrome 31
* Also makes showCodeMirrorPopup() size stylable
This commit is contained in:
parent
a9ff8c14f3
commit
d2441213ef
|
@ -243,6 +243,14 @@
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
#help-popup.big {
|
||||||
|
max-width: 100%;
|
||||||
|
left: 3rem;
|
||||||
|
}
|
||||||
|
#help-popup.big .CodeMirror {
|
||||||
|
min-height: 2rem;
|
||||||
|
height: 70vh;
|
||||||
|
}
|
||||||
#help-popup .title {
|
#help-popup .title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: rgba(0,0,0,0.05);
|
background-color: rgba(0,0,0,0.05);
|
||||||
|
|
5
edit.js
5
edit.js
|
@ -1529,7 +1529,7 @@ function showLintHelp() {
|
||||||
|
|
||||||
function showHelp(title, text) {
|
function showHelp(title, text) {
|
||||||
var div = document.getElementById("help-popup");
|
var div = document.getElementById("help-popup");
|
||||||
div.style.cssText = "";
|
div.classList.remove("big");
|
||||||
div.querySelector(".contents").innerHTML = text;
|
div.querySelector(".contents").innerHTML = text;
|
||||||
div.querySelector(".title").innerHTML = title;
|
div.querySelector(".title").innerHTML = title;
|
||||||
|
|
||||||
|
@ -1552,7 +1552,7 @@ function showHelp(title, text) {
|
||||||
|
|
||||||
function showCodeMirrorPopup(title, html, options) {
|
function showCodeMirrorPopup(title, html, options) {
|
||||||
var popup = showHelp(title, html);
|
var popup = showHelp(title, html);
|
||||||
popup.style.width = popup.style.maxWidth = "calc(100vw - 7rem)";
|
popup.classList.add("big");
|
||||||
|
|
||||||
popup.codebox = CodeMirror(popup.querySelector(".contents"), shallowMerge(options, {
|
popup.codebox = CodeMirror(popup.querySelector(".contents"), shallowMerge(options, {
|
||||||
mode: "css",
|
mode: "css",
|
||||||
|
@ -1567,7 +1567,6 @@ function showCodeMirrorPopup(title, html, options) {
|
||||||
keyMap: prefs.getPref("editor.keyMap")
|
keyMap: prefs.getPref("editor.keyMap")
|
||||||
}));
|
}));
|
||||||
popup.codebox.focus();
|
popup.codebox.focus();
|
||||||
popup.codebox.setSize(null, "70vh");
|
|
||||||
popup.codebox.on("focus", function() { hotkeyRerouter.setState(false) });
|
popup.codebox.on("focus", function() { hotkeyRerouter.setState(false) });
|
||||||
popup.codebox.on("blur", function() { hotkeyRerouter.setState(true) });
|
popup.codebox.on("blur", function() { hotkeyRerouter.setState(true) });
|
||||||
return popup;
|
return popup;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user