Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions zeppelin-web/src/app/notebook/paragraph/paragraph-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
<a ng-click="showLineNumbers()"
ng-show="!paragraph.config.lineNumbers"><span class="fa fa-list-ol"></span> Show line numbers</a>
</li>
<li>
<a ng-click="$event.stopPropagation()" class="dropdown"><span class="fa fa-ellipsis-h"></span> TabSize
<form style="display:inline; margin-left:5px;">
<select ng-model="paragraph.config.tabSize"
class="selectpicker"
ng-change="changeTabSize()"
ng-options="col for col in tabSizeOption"></select>
</form>
</a>
</li>
<li>
<a ng-click="toggleEnableDisable()"><span class="icon-control-play"></span>
{{paragraph.config.enabled ? "Disable" : "Enable"}} run</a>
Expand Down
13 changes: 13 additions & 0 deletions zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ angular.module('zeppelinWebApp')
$scope.originalText = angular.copy(newParagraph.text);
$scope.chart = {};
$scope.colWidthOption = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
$scope.tabSizeOption = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
$scope.showTitleEditor = false;
$scope.paragraphFocused = false;
if (newParagraph.focus) {
Expand Down Expand Up @@ -285,6 +286,10 @@ angular.module('zeppelinWebApp')
config.colWidth = 12;
}

if (!config.tabSize) {
config.tabSize = 4;
}

if (!config.graph) {
config.graph = {};
}
Expand Down Expand Up @@ -643,6 +648,14 @@ angular.module('zeppelinWebApp')
commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
};

$scope.changeTabSize = function() {
var newParams = angular.copy($scope.paragraph.settings.params);
var newConfig = angular.copy($scope.paragraph.config);
$scope.editor.getSession().setTabSize($scope.paragraph.config.tabSize);

commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
};

$scope.toggleGraphOption = function() {
var newConfig = angular.copy($scope.paragraph.config);
if (newConfig.graph.optionOpen) {
Expand Down