Add configSubmit, make dashboard app broadcast 'application.load', don't recreate dashboard module

This commit is contained in:
Rashid Khan 2014-02-27 16:53:17 -07:00
parent ac9d7ef299
commit 360a1f2821
3 changed files with 9 additions and 4 deletions

View file

@ -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>

View file

@ -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,
};

View file

@ -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>