From 3c450e7d9dafb2128714b6214a4dd49f55c7bb72 Mon Sep 17 00:00:00 2001 From: eight Date: Wed, 13 Sep 2017 20:28:19 +0800 Subject: [PATCH] Fix: resize grip style --- edit/edit.css | 14 +++++++------- edit/edit.js | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/edit/edit.css b/edit/edit.css index 9297b20f..19e57589 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -178,7 +178,10 @@ h2 .svg-icon, label .svg-icon { .CodeMirror { border: solid #CCC 1px; } -.CodeMirror-scroll { +.CodeMirror-lint-mark-warning { + background: none; +} +.resize-grip-enabled .CodeMirror-scroll { height: auto !important;; position: absolute !important; top: 0; @@ -186,16 +189,13 @@ h2 .svg-icon, label .svg-icon { right: 0; bottom: 6px; /* resize-grip height */ } -.CodeMirror-lint-mark-warning { - background: none; -} -.CodeMirror-vscrollbar { +.resize-grip-enabled .CodeMirror-vscrollbar { margin-bottom: 7px; /* make space for resize-grip */ } -.CodeMirror-hscrollbar { +.resize-grip-enabled .CodeMirror-hscrollbar { bottom: 7px; /* make space for resize-grip */ } -.CodeMirror-scrollbar-filler { +.resize-grip-enabled .CodeMirror-scrollbar-filler { bottom: 7px; /* make space for resize-grip */ } .CodeMirror-dialog { diff --git a/edit/edit.js b/edit/edit.js index b5135f29..0187abdc 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -424,6 +424,7 @@ function setupCodeMirror(textarea, index) { cm.on('mousedown', (cm, event) => toggleContextMenuDelete.call(cm, event)); } + wrapper.classList.add('resize-grip-enabled'); let lastClickTime = 0; const resizeGrip = wrapper.appendChild(template.resizeGrip.cloneNode(true)); resizeGrip.onmousedown = event => {