Skip to content

Commit

Permalink
Add configSubmit, make dashboard app broadcast 'application.load', do…
Browse files Browse the repository at this point in the history
…n't recreate dashboard module
  • Loading branch information
Rashid Khan committed Feb 27, 2014
1 parent ac9d7ef commit 360a1f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/kibana/apps/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<li><a class="link" ng-click="openLoad()"><i class="fa fa-folder-open"></i></a></li>
</ul>
</nav>
<config config-template="configTemplate" config-object="configurable" config-close="configClose"></config>
<config config-template="configTemplate" config-object="configurable" config-close="configClose" config-submit="configSubmit"></config>

<div class="container-default">
<ul dashboard-grid grid="dashboard.panels" control="gridControl"></ul>
Expand Down
9 changes: 7 additions & 2 deletions src/kibana/apps/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ define(function (require) {
require('gridster');


var app = angular.module('app/dashboard', []);
var app = angular.module('app/dashboard');

app.controller('dashboard', function ($scope, courier) {

$scope.$broadcast('application.load');

// Passed in the grid attr to the directive so we can access the directive's function from
// the controller and view
$scope.gridControl = {foo: true};
Expand All @@ -24,6 +26,9 @@ define(function (require) {
$scope.configClose = function () {
console.log('SAVE close');
};
$scope.configSubmit = function () {
$scope.save($scope.dashboard.title);
};
};

$scope.openLoad = function () {
Expand Down Expand Up @@ -127,7 +132,7 @@ define(function (require) {
};

$scope.configurable = {
dashboard: $scope.dashboard
dashboard: $scope.dashboard,
};


Expand Down
2 changes: 1 addition & 1 deletion src/kibana/partials/navConfig.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="config" ng-show="configTemplate">
<i class="pull-right fa fa-times remove" ng-click="close()" />
<form role="form">
<form role="form" ng-submit="configSubmit()">
<div ng-include="configTemplate" />
</form>
</div>

0 comments on commit 360a1f2

Please sign in to comment.