public inbox for [email protected]
help / color / mirror / Atom feedFrom: Neethu Mariya Joy <[email protected]>
To: [email protected]
Subject: Bug #2309 fix
Date: Wed, 28 Feb 2018 00:17:31 +0530
Message-ID: <CAAdJd1Mwu7ths9DfsjZNOshML9wq_guMb5vXzrKhH-8kZojvbQ@mail.gmail.com> (raw)
Hi,
I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science at
BITS Pilani.
I've attempted to fix https://redmine.postgresql.org/issues/2309.
Codemirrors catches all the keyboard and mouse events when 'readOnly'
option is set to 'noCursor' and does not allow copying.
So, I've set 'readOnly' option to true. In order to hide the cursor, I've
added a class 'hide-cursor-workaround' and applied css styles to hide the
cursor.
I'm attaching my patch as bug2309.diff below as per the contribution
guidelines.
Hope this helps. Thank you for your consideration!
Sincerely,
Neethu Mariya Joy
GitHub <https://github.com/Roboneet; | Linkedin
<https://www.linkedin.com/in/neethu-mariya-joy-653655128/;
diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
index 1e29c3f..69381e5 100644
--- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
+++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
@@ -601,4 +601,9 @@ input.editor-checkbox:focus {
.ajs-body .warn-footer {
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;
}
\ No newline at end of file
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 349c9a0..91dbe3a 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2016,12 +2016,12 @@ define('tools.querytool', [
}
}
else {
- // Disable codemirror by setting cursor to nocursor and background to dark.
+ // Disable codemirror by setting readOnly option to true, background to dark, and cursor, hidden.
self.init_events();
- self.gridView.query_tool_obj.setOption('readOnly', 'nocursor');
+ self.gridView.query_tool_obj.setOption('readOnly', true);
var cm = self.gridView.query_tool_obj.getWrapperElement();
if (cm) {
- cm.className += ' bg-gray-1 opacity-5';
+ cm.className += ' bg-gray-1 opacity-5 hide-cursor-workaround';
}
self.disable_tool_buttons(true);
self.execute_data_query();
Attachments:
[text/plain] bug2309.diff (1.6K, 3-bug2309.diff)
download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
index 1e29c3f..69381e5 100644
--- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
+++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
@@ -601,4 +601,9 @@ input.editor-checkbox:focus {
.ajs-body .warn-footer {
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;
}
\ No newline at end of file
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 349c9a0..91dbe3a 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2016,12 +2016,12 @@ define('tools.querytool', [
}
}
else {
- // Disable codemirror by setting cursor to nocursor and background to dark.
+ // Disable codemirror by setting readOnly option to true, background to dark, and cursor, hidden.
self.init_events();
- self.gridView.query_tool_obj.setOption('readOnly', 'nocursor');
+ self.gridView.query_tool_obj.setOption('readOnly', true);
var cm = self.gridView.query_tool_obj.getWrapperElement();
if (cm) {
- cm.className += ' bg-gray-1 opacity-5';
+ cm.className += ' bg-gray-1 opacity-5 hide-cursor-workaround';
}
self.disable_tool_buttons(true);
self.execute_data_query();
view thread (6+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Bug #2309 fix
In-Reply-To: <CAAdJd1Mwu7ths9DfsjZNOshML9wq_guMb5vXzrKhH-8kZojvbQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox