mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add configSubmit, make dashboard app broadcast 'application.load', don't recreate dashboard module
This commit is contained in:
parent
3aaf729692
commit
cfe3257cfb
3 changed files with 9 additions and 4 deletions
|
@ -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>
|
||||
|
|
|
@ -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};
|
||||
|
@ -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 () {
|
||||
|
@ -127,7 +132,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
$scope.configurable = {
|
||||
dashboard: $scope.dashboard
|
||||
dashboard: $scope.dashboard,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue