Trying out an alternative to modals
This commit is contained in:
@@ -61,4 +61,18 @@ function (angular, app, _) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
module.controller('EditViewCtrl', function($scope) {
|
||||||
|
//$scope.editPanelSrc = 'app/partials/test.html';
|
||||||
|
|
||||||
|
$scope.onAppEvent('show-edit-panel', function(evt, payload) {
|
||||||
|
$scope.editPanelSrc = payload.src;
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.dismiss = function() {
|
||||||
|
$scope.editPanelSrc = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ function (angular, _, config, $) {
|
|||||||
"#58140C","#052B51","#511749","#3F2B5B",
|
"#58140C","#052B51","#511749","#3F2B5B",
|
||||||
];
|
];
|
||||||
var color = colors[Math.abs(hash % colors.length)];
|
var color = colors[Math.abs(hash % colors.length)];
|
||||||
console.log("namei " + name + " color: " + color, hash % 4);
|
|
||||||
element.css("background-color", color);
|
element.css("background-color", color);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,12 @@ function (angular, _, $) {
|
|||||||
var id = '#' + partial.replace('.html', '').replace(/[\/|\.|:]/g, '-') + '-' + scope.$id;
|
var id = '#' + partial.replace('.html', '').replace(/[\/|\.|:]/g, '-') + '-' + scope.$id;
|
||||||
|
|
||||||
elem.bind('click',function() {
|
elem.bind('click',function() {
|
||||||
|
$timeout(function() {
|
||||||
|
scope.exitFullscreen();
|
||||||
|
scope.emitAppEvent('show-edit-panel', {src: partial});
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
|
||||||
if ($(id).length) {
|
if ($(id).length) {
|
||||||
elem.attr('data-target', id).attr('data-toggle', 'modal');
|
elem.attr('data-target', id).attr('data-toggle', 'modal');
|
||||||
scope.$apply(function() { scope.$broadcast('modal-opened'); });
|
scope.$apply(function() { scope.$broadcast('modal-opened'); });
|
||||||
|
|||||||
@@ -8,8 +8,12 @@
|
|||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
<div ng-controller="EditViewCtrl">
|
||||||
|
<div ng-if="editPanelSrc" ng-include="editPanelSrc">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="main-view-container">
|
<div class="main-view-container">
|
||||||
<!-- Rows -->
|
|
||||||
<div class="grafana-row" ng-controller="RowCtrl" ng-repeat="(row_name, row) in dashboard.rows" row-height>
|
<div class="grafana-row" ng-controller="RowCtrl" ng-repeat="(row_name, row) in dashboard.rows" row-height>
|
||||||
<div class="row-control">
|
<div class="row-control">
|
||||||
<div class="row-control-inner" style="padding:0px;margin:0px;position:relative;">
|
<div class="row-control-inner" style="padding:0px;margin:0px;position:relative;">
|
||||||
@@ -100,14 +104,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ng-show='dashboard.editable' class="row-fluid add-row-panel-hint">
|
<div ng-show='dashboard.editable' class="row-fluid add-row-panel-hint">
|
||||||
<div class="span12" style="text-align:right;">
|
<div class="span12" style="text-align:right;">
|
||||||
<span style="margin-right: 10px;" ng-click="add_row_default()" class="pointer btn btn-info btn-mini">
|
<span style="margin-right: 10px;" ng-click="add_row_default()" class="pointer btn btn-info btn-mini">
|
||||||
<span><i class="icon-plus-sign"></i> ADD A ROW</span>
|
<span><i class="icon-plus-sign"></i> ADD A ROW</span>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-include="'app/partials/console.html'" ng-if="consoleEnabled">
|
<div ng-include="'app/partials/console.html'" ng-if="consoleEnabled">
|
||||||
|
|||||||
Reference in New Issue
Block a user