Commit 00e5bb61 by Torkel Ödegaard

Trying out an alternative to modals

parent b506e7c2
......@@ -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",
];
var color = colors[Math.abs(hash % colors.length)];
console.log("namei " + name + " color: " + color, hash % 4);
element.css("background-color", color);
};
......
......@@ -16,6 +16,12 @@ function (angular, _, $) {
var id = '#' + partial.replace('.html', '').replace(/[\/|\.|:]/g, '-') + '-' + scope.$id;
elem.bind('click',function() {
$timeout(function() {
scope.exitFullscreen();
scope.emitAppEvent('show-edit-panel', {src: partial});
});
return;
if ($(id).length) {
elem.attr('data-target', id).attr('data-toggle', 'modal');
scope.$apply(function() { scope.$broadcast('modal-opened'); });
......
......@@ -8,8 +8,12 @@
<div class="clearfix"></div>
<div ng-controller="EditViewCtrl">
<div ng-if="editPanelSrc" ng-include="editPanelSrc">
</div>
</div>
<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="row-control">
<div class="row-control-inner" style="padding:0px;margin:0px;position:relative;">
......@@ -100,7 +104,6 @@
</div>
</div>
</div>
</div>
<div ng-show='dashboard.editable' class="row-fluid add-row-panel-hint">
<div class="span12" style="text-align:right;">
......@@ -110,6 +113,8 @@
</div>
</div>
</div>
<div ng-include="'app/partials/console.html'" ng-if="consoleEnabled">
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment