mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
set the mode externally so that the output can contain text in the future
This commit is contained in:
parent
d27d841fc2
commit
38471f9694
2 changed files with 10 additions and 4 deletions
|
@ -216,14 +216,14 @@ define([
|
|||
exec: function () {
|
||||
output.update('');
|
||||
submitCurrentRequestToES(function (resp) {
|
||||
output.update(resp);
|
||||
output.update(resp, 'ace/mode/json');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$send.click(function () {
|
||||
submitCurrentRequestToES(function (resp) {
|
||||
output.update(resp);
|
||||
output.update(resp, 'ace/mode/json');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -8,9 +8,15 @@ define([
|
|||
var $el = $("#output");
|
||||
var output = ace.require('ace/ace').edit($el[0]);
|
||||
|
||||
output.update = function (val, cb) {
|
||||
output.update = function (val, mode, cb) {
|
||||
if (typeof mode === 'function') {
|
||||
cb = mode;
|
||||
mode = void 0;
|
||||
}
|
||||
|
||||
var session = output.getSession();
|
||||
session.setMode(val ? 'ace/mode/json' : 'ace/mode/text');
|
||||
|
||||
session.setMode(val ? (mode || 'ace/mode/json') : 'ace/mode/text');
|
||||
session.setValue(val);
|
||||
if (typeof cb === 'function') {
|
||||
setTimeout(cb);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue