Allow copying of SQL from the dashboard tables. Fixes #3137

This commit is contained in:
Neethu Mariya Joy
2018-03-02 14:39:12 +00:00
committed by Dave Page
parent 7471dea458
commit 0c48b79ce7
3 changed files with 8 additions and 7 deletions

View File

@@ -81,3 +81,8 @@
.sql_textarea .CodeMirror-scroll {
z-index: 0;
}
/* workaround for codemirrors 'readOnly' option which is set to true instead of 'noCursor' */
.hide-cursor-workaround .CodeMirror-cursors {
display: none;
}

View File

@@ -2103,10 +2103,11 @@ define([
// Disable editor
if (isDisabled) {
self.sqlCtrl.setOption('readOnly', 'nocursor');
// set read only mode to true instead of 'nocursor', and hide cursor using a class so that copying is enabled
self.sqlCtrl.setOption('readOnly', true);
var cm = self.sqlCtrl.getWrapperElement();
if (cm) {
cm.className += ' cm_disabled';
cm.className += ' cm_disabled hide-cursor-workaround';
}
}

View File

@@ -602,8 +602,3 @@ input.editor-checkbox:focus {
font-size: 13px;
line-height: 3em;
}
/* workaround for codemirrors 'readOnly' option which is set to true instead of 'noCursor' */
.hide-cursor-workaround .CodeMirror-cursors {
display: none;
}