SqlFieldControl enhancements

This commit is contained in:
Surinder Kumar 2016-08-29 13:21:45 +05:30 committed by Akshay Joshi
parent f12d981a9d
commit 2d75eac117
2 changed files with 20 additions and 1 deletions

View File

@ -1391,3 +1391,14 @@ table.backgrid {
.cm_disabled {
background: #EEEEEE;
}
.pgadmin-controls.sql_field_layout {
margin: 0;
padding: 0;
overflow: hidden;
z-index: 1;
}
.pgadmin-controls.sql_field_layout .CodeMirror {
line-height: 22px;
}

View File

@ -2131,11 +2131,19 @@
(self.$el.find("textarea")[0]), {
lineNumbers: true,
mode: "text/x-sql",
readOnly: isDisabled,
extraKeys: pgAdmin.Browser.editor_shortcut_keys,
tabSize: pgAdmin.Browser.editor_options.tabSize
});
// Disable editor
if (isDisabled) {
self.sqlCtrl.setOption("readOnly", "nocursor");
var cm = self.sqlCtrl.getWrapperElement();
if (cm) {
cm.className += ' cm_disabled';
}
}
if (!isVisible)
self.$el.addClass(Backform.hiddenClassname);