[#144] Allow users to edit raw JSON visualization options

This commit is contained in:
Amir Nissim 2014-03-25 17:06:28 +02:00
parent 61a196fafc
commit 839abe627e
3 changed files with 9 additions and 0 deletions

View File

@ -335,6 +335,9 @@
ngModel.$parsers.push(into);
ngModel.$formatters.push(out);
scope.$watch(attr.ngModel, function(newValue) {
element[0].value = out(newValue);
}, true);
}
};
});

View File

@ -102,6 +102,7 @@
visualization: '=?'
},
link: function (scope, element, attrs) {
scope.editRawOptions = currentUser.hasPermission('edit_raw_chart');
scope.visTypes = Visualization.visualizationTypes;
scope.newVisualization = function(q) {

View File

@ -11,6 +11,11 @@
<visualization-options-editor></visualization-options-editor>
<div class="form-group" ng-if="editRawOptions">
<label class="control-label">Advanced</label>
<textarea json-text ng-model="visualization.options" class="form-control" rows="10"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Save</button>
</div>