mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-14 10:36:19 +02:00
add events n fix minimize height of console
This commit is contained in:
@ -106,7 +106,7 @@
|
|||||||
<div class="js-console__header code-wrap__header" title="Double click to toggle console">
|
<div class="js-console__header code-wrap__header" title="Double click to toggle console">
|
||||||
<span class="code-wrap__header-label">Console (<span id="logCountEl">0</span>)</span>
|
<span class="code-wrap__header-label">Console (<span id="logCountEl">0</span>)</span>
|
||||||
<div class="code-wrap__header-right-options">
|
<div class="code-wrap__header-right-options">
|
||||||
<a class="code-wrap__header-btn" title="Clear console (CTRL + L)" d-click="clearConsole">
|
<a class="code-wrap__header-btn" title="Clear console (CTRL + L)" d-click="onClearConsoleBtnClick">
|
||||||
<svg>
|
<svg>
|
||||||
<use xlink:href="#cancel-icon"></use>
|
<use xlink:href="#cancel-icon"></use>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -1318,16 +1318,22 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl
|
|||||||
|
|
||||||
scope.toggleConsole = function () {
|
scope.toggleConsole = function () {
|
||||||
consoleEl.classList.toggle('is-minimized');
|
consoleEl.classList.toggle('is-minimized');
|
||||||
|
trackEvent('ui', 'consoleToggle');
|
||||||
};
|
};
|
||||||
scope.clearConsole = function () {
|
scope.clearConsole = function () {
|
||||||
scope.consoleCm.setValue('');
|
scope.consoleCm.setValue('');
|
||||||
logCount = 0;
|
logCount = 0;
|
||||||
logCountEl.textContent = logCount;
|
logCountEl.textContent = logCount;
|
||||||
};
|
};
|
||||||
|
scope.onClearConsoleBtnClick = function () {
|
||||||
|
scope.clearConsole();
|
||||||
|
trackEvent('ui', 'consoleClearBtnClick');
|
||||||
|
};
|
||||||
scope.evalConsoleExpr = function (e) {
|
scope.evalConsoleExpr = function (e) {
|
||||||
// Clear console on CTRL + L
|
// Clear console on CTRL + L
|
||||||
if (((e.which === 76 || e.which === 12) && e.ctrlKey)) {
|
if (((e.which === 76 || e.which === 12) && e.ctrlKey)) {
|
||||||
scope.clearConsole();
|
scope.clearConsole();
|
||||||
|
trackEvent('ui', 'consoleClearKeyboardShortcut');
|
||||||
} else if (e.which === 13) {
|
} else if (e.which === 13) {
|
||||||
window.onMessageFromConsole('> ' + e.target.value);
|
window.onMessageFromConsole('> ' + e.target.value);
|
||||||
|
|
||||||
@ -1337,6 +1343,7 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl
|
|||||||
/* eslint-enable no-underscore-dangle */
|
/* eslint-enable no-underscore-dangle */
|
||||||
|
|
||||||
e.target.value = '';
|
e.target.value = '';
|
||||||
|
trackEvent('fn', 'evalConsoleExpr');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
window.onMessageFromConsole = function() {
|
window.onMessageFromConsole = function() {
|
||||||
@ -1574,6 +1581,7 @@ runBtn, searchInput, consoleEl, consoleLogEl, logCountEl
|
|||||||
var target = e.target;
|
var target = e.target;
|
||||||
if (target.classList.contains('js-console__header')) {
|
if (target.classList.contains('js-console__header')) {
|
||||||
scope.toggleConsole();
|
scope.toggleConsole();
|
||||||
|
trackEvent('ui', 'consoleToggleDblClick');
|
||||||
}
|
}
|
||||||
if (target.classList.contains('js-code-wrap__header')) {
|
if (target.classList.contains('js-code-wrap__header')) {
|
||||||
var codeWrapParent = target.parentElement;
|
var codeWrapParent = target.parentElement;
|
||||||
|
@ -828,7 +828,8 @@ li.CodeMirror-hint-active {
|
|||||||
z-index: 1; /* bring above iframe */
|
z-index: 1; /* bring above iframe */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 30vh;
|
min-height: 80px;
|
||||||
|
height: 35vh;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
|
Reference in New Issue
Block a user