Only allow resizing textarea vertically
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
This commit is contained in:
parent
3f26fa5cd0
commit
d67b1391ce
@ -374,9 +374,10 @@ const DatabaseEvents = {
|
||||
* the Definition textarea.
|
||||
*/
|
||||
var $elm = $('textarea[name=item_definition]').last();
|
||||
var linterOptions = {};
|
||||
linterOptions.eventEditor = true;
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
|
||||
var linterOptions = {
|
||||
eventEditor: true,
|
||||
};
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'vertical', linterOptions);
|
||||
}); // end $.get()
|
||||
},
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ AJAX.registerTeardown('database/multi_table_query.js', function () {
|
||||
});
|
||||
|
||||
AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
var editor = Functions.getSqlEditor($('#MultiSqlquery'), {}, 'both');
|
||||
var editor = Functions.getSqlEditor($('#MultiSqlquery'), {}, 'vertical');
|
||||
$('.CodeMirror-line').css('text-align', 'left');
|
||||
editor.setSize(-1, 50);
|
||||
|
||||
|
||||
@ -391,9 +391,10 @@ const DatabaseRoutines = {
|
||||
* the Definition textarea.
|
||||
*/
|
||||
var $elm = $('textarea[name=item_definition]').last();
|
||||
var linterOptions = {};
|
||||
linterOptions.routineEditor = true;
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
|
||||
var linterOptions = {
|
||||
routineEditor: true,
|
||||
};
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'vertical', linterOptions);
|
||||
|
||||
// Execute item-specific code
|
||||
that.postDialogShow(data);
|
||||
|
||||
@ -382,9 +382,10 @@ const DatabaseTriggers = {
|
||||
* the Definition textarea.
|
||||
*/
|
||||
var $elm = $('textarea[name=item_definition]').last();
|
||||
var linterOptions = {};
|
||||
linterOptions.triggerEditor = true;
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
|
||||
var linterOptions = {
|
||||
triggerEditor: true,
|
||||
};
|
||||
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'vertical', linterOptions);
|
||||
}); // end $.get()
|
||||
},
|
||||
|
||||
|
||||
@ -256,27 +256,8 @@ function getSqlEditor ($textarea, options, resize, lintOptions) {
|
||||
resizeType = 'vertical';
|
||||
}
|
||||
|
||||
var handles = '';
|
||||
if (resizeType === 'vertical') {
|
||||
handles = 's';
|
||||
}
|
||||
|
||||
if (resizeType === 'both') {
|
||||
handles = 'all';
|
||||
}
|
||||
|
||||
if (resizeType === 'horizontal') {
|
||||
handles = 'e, w';
|
||||
}
|
||||
|
||||
$(codemirrorEditor.getWrapperElement())
|
||||
.css('resize', resizeType)
|
||||
.resizable({
|
||||
handles: handles,
|
||||
resize: function () {
|
||||
codemirrorEditor.setSize($(this).width(), $(this).height());
|
||||
}
|
||||
});
|
||||
.css('resize', resizeType);
|
||||
|
||||
// enable autocomplete
|
||||
codemirrorEditor.on('inputRead', Functions.codeMirrorAutoCompleteOnInputRead);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user