[ui-ace] prevent ace editor deprecation warnings

This commit is contained in:
spalger 2015-08-25 13:08:19 -07:00
parent 2f780507bf
commit de4ea544c6
3 changed files with 25 additions and 15 deletions

View file

@ -129,6 +129,8 @@ define(function (require) {
if (_.contains(loadedEditors, editor)) return;
loadedEditors.push(editor);
editor.$blockScrolling = Infinity;
var session = editor.getSession();
var fieldName = editor.container.id;

View file

@ -62,6 +62,7 @@
readonly
ui-ace="{
useWrapMode: true,
onLoad: aceLoaded,
advanced: {
highlightActiveLine: false
},

View file

@ -17,24 +17,31 @@ define(function (require) {
filter: '=?',
columns: '=?'
},
link: function ($scope, $el, attr) {
// If a field isn't in the mapping, use this
$scope.mode = 'table';
$scope.mapping = $scope.indexPattern.fields.byName;
$scope.flattened = $scope.indexPattern.flattenHit($scope.hit);
$scope.hitJson = angular.toJson($scope.hit, true);
$scope.formatted = $scope.indexPattern.formatHit($scope.hit);
$scope.fields = _.keys($scope.flattened).sort();
link: {
pre($scope) {
$scope.aceLoaded = (editor) => {
editor.$blockScrolling = Infinity;
};
},
$scope.toggleColumn = function (fieldName) {
_.toggleInOut($scope.columns, fieldName);
};
post($scope, $el, attr) {
// If a field isn't in the mapping, use this
$scope.mode = 'table';
$scope.mapping = $scope.indexPattern.fields.byName;
$scope.flattened = $scope.indexPattern.flattenHit($scope.hit);
$scope.hitJson = angular.toJson($scope.hit, true);
$scope.formatted = $scope.indexPattern.formatHit($scope.hit);
$scope.fields = _.keys($scope.flattened).sort();
$scope.showArrayInObjectsWarning = function (row, field) {
var value = $scope.flattened[field];
return _.isArray(value) && typeof value[0] === 'object';
};
$scope.toggleColumn = function (fieldName) {
_.toggleInOut($scope.columns, fieldName);
};
$scope.showArrayInObjectsWarning = function (row, field) {
var value = $scope.flattened[field];
return _.isArray(value) && typeof value[0] === 'object';
};
}
}
};
});