Adding hidden options for widgets.

This commit is contained in:
jvasquez 2015-09-09 14:14:27 -03:00
parent 98307aec0d
commit d474267934
4 changed files with 13 additions and 2 deletions

View File

@ -125,6 +125,12 @@
};
var WidgetCtrl = function($scope, $location, Events, Query) {
$scope.disableWidget = {'visibility': 'visible'};
$scope.checkWidth = function (width) {
if (width == 0)
$scope.disableWidget = {'visibility': 'hidden'};
}
$scope.deleteWidget = function() {
if (!confirm('Are you sure you want to remove "' + $scope.widget.getName() + '" from the dashboard?')) {
return;

View File

@ -123,6 +123,9 @@
replace: true,
link: function($scope, element, attrs) {
$scope.widgetSizes = [{
name: 'Hidden',
value: 0
}, {
name: 'Regular',
value: 1
}, {
@ -186,7 +189,6 @@
$scope.saveWidget = function() {
$scope.saveInProgress = true;
var widget = new Widget({
'visualization_id': $scope.selectedVis && $scope.selectedVis.id,
'dashboard_id': $scope.dashboard.id,

View File

@ -48,6 +48,9 @@ angular.module('redash.filters', []).
.filter('colWidth', function () {
return function (widgetWidth) {
if (widgetWidth == 0) {
return 0;
}
if (widgetWidth == 1) {
return 6;
}

View File

@ -58,7 +58,7 @@
</div>
</div>
<div class="panel panel-default rd-widget-textbox" ng-if="type=='textbox'" ng-mouseenter="showControls = true" ng-mouseleave="showControls = false">
<div class="panel panel-default rd-widget-textbox" ng-style="disableWidget" ng-init="checkWidth(widget.width)" ng-if="type=='textbox'" ng-mouseenter="showControls = true" ng-mouseleave="showControls = false">
<div class="panel-body">
<div class="row">
<div class="col-lg-11">