public inbox for [email protected]
help / color / mirror / Atom feedFrom: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM#1423 - SQL panel should be greyed in Edit Data mode
Date: Tue, 5 Jul 2016 15:23:39 +0530
Message-ID: <CAM5-9D8zXiykcgp1ZhDrPqUOwDSF+0_QXnr-QM3ZZA0zfj+Lug@mail.gmail.com> (raw)
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi
Please find the attached patch with solution:
1. Introduced a new class 'cm_disabled' with css property
background-color to '#EEEEE'
2. Query tool in edit mode, add the class 'cm_disabled' to set
background color to dark and set the cursor property to 'nocursor' to
disable editor.
3. Increased the query tool title padding to fix the issue of whitespace
below the title.
Please review.
Thanks,
Surinder Kumar
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[application/octet-stream] RM#1423.patch (1.6K, 3-RM%231423.patch)
download | inline diff:
diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css
index d4e09c0..2536fe3 100755
--- a/web/pgadmin/static/css/overrides.css
+++ b/web/pgadmin/static/css/overrides.css
@@ -1359,3 +1359,8 @@ table.backgrid {
.aciTree.aciTreeLoad {
background: none;
}
+
+/* class to disable Codemirror editor */
+.cm_disabled {
+ background: #EEEEEE;
+}
diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
index b5905da..93c7921 100644
--- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
+++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
@@ -35,7 +35,7 @@
.editor-title {
background-color: #2C76B4;
- padding: 2px;
+ padding: 4px 5px;
color: white;
font-size: 13px;
}
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 5b08623..b4c48e8 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -1124,7 +1124,12 @@ define(
}
}
else {
- self.gridView.query_tool_obj.setOption("readOnly",true);
+ // Disable codemirror by setting cursor to nocursor and background to dark.
+ self.gridView.query_tool_obj.setOption("readOnly", 'nocursor');
+ var cm = self.gridView.query_tool_obj.getWrapperElement();
+ if (cm) {
+ cm.className += ' cm_disabled';
+ }
self.disable_tool_buttons(true);
self._execute_data_query();
}
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: [pgAdmin4][Patch]: RM#1423 - SQL panel should be greyed in Edit Data mode
In-Reply-To: <CAM5-9D8zXiykcgp1ZhDrPqUOwDSF+0_QXnr-QM3ZZA0zfj+Lug@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