mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
Adding hidden options for widgets.
This commit is contained in:
parent
98307aec0d
commit
d474267934
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -48,6 +48,9 @@ angular.module('redash.filters', []).
|
||||
|
||||
.filter('colWidth', function () {
|
||||
return function (widgetWidth) {
|
||||
if (widgetWidth == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (widgetWidth == 1) {
|
||||
return 6;
|
||||
}
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user