Fixes for minification of controllers.
This commit is contained in:
parent
76233fec2a
commit
ecd21e050b
|
@ -11,86 +11,85 @@
|
|||
// TODO Make this a bit more AngularJS module looking...
|
||||
|
||||
// Controls the task list.
|
||||
TaskListController.$inject = ['$scope', 'Task'];
|
||||
rookeriesApp.controller(
|
||||
"TaskListController", ['$scope', 'Task', function ($scope, Task) {
|
||||
|
||||
function TaskListController($scope, Task) {
|
||||
$scope.tasks = Task.query();
|
||||
$scope.orderProp = 'id';
|
||||
$scope.tasks = Task.query();
|
||||
$scope.orderProp = 'id';
|
||||
|
||||
// TODO Build this out properly.
|
||||
$scope.popup = function(task) {
|
||||
alert("I am task #" + task.id);
|
||||
}
|
||||
}
|
||||
// TODO Build this out properly.
|
||||
$scope.popup = function(task) {
|
||||
alert("I am task #" + task.id);
|
||||
}
|
||||
}]);
|
||||
|
||||
// Control the detailed view of a task.
|
||||
TaskDetailController.$inject = ['$scope', '$routeParams', 'Task'];
|
||||
rookeriesApp.controller(
|
||||
"TaskDetailController", ['$scope', '$stateParams', 'Task', function ($scope, $stateParams, Task) {
|
||||
|
||||
function TaskDetailController($scope, $stateParams, Task) {
|
||||
$scope.task = Task.get(
|
||||
{taskId: $stateParams.taskId}, function($scope, $stateParams, task) {
|
||||
$scope.task = Task.get(
|
||||
{taskId: $stateParams.taskId}, function($scope, $stateParams, task) {
|
||||
|
||||
$scope.task = task.task;
|
||||
$scope.id = $stateParams.taskId;
|
||||
});
|
||||
}]);
|
||||
|
||||
$scope.task = task.task;
|
||||
$scope.id = $stateParams.taskId;
|
||||
});
|
||||
}
|
||||
// TODO Clean up experimental code...
|
||||
ModalDemoCtrl = function ($scope) {
|
||||
rookeriesApp.controller(
|
||||
"ModalDemoCtrl", ["$scope", function ($scope) {
|
||||
|
||||
$scope.open = function () {
|
||||
$scope.shouldBeOpen = true;
|
||||
};
|
||||
$scope.open = function () {
|
||||
$scope.shouldBeOpen = true;
|
||||
};
|
||||
|
||||
$scope.close = function () {
|
||||
$scope.closeMsg = 'I was closed at: ' + new Date();
|
||||
$scope.shouldBeOpen = false;
|
||||
};
|
||||
$scope.close = function () {
|
||||
$scope.closeMsg = 'I was closed at: ' + new Date();
|
||||
$scope.shouldBeOpen = false;
|
||||
};
|
||||
|
||||
$scope.items = ['item1', 'item2'];
|
||||
$scope.items = ['item1', 'item2'];
|
||||
|
||||
$scope.opts = {
|
||||
backdropFade: true,
|
||||
dialogFade:true
|
||||
};
|
||||
|
||||
};
|
||||
$scope.opts = {
|
||||
backdropFade: true,
|
||||
dialogFade:true
|
||||
};
|
||||
}]);
|
||||
|
||||
// Setup of document pages.
|
||||
DocPageController.$inject = ['$scope', '$stateParams', 'DocPage'];
|
||||
function DocPageController($scope, $stateParams, DocPage) {
|
||||
rookeriesApp.controller(
|
||||
"DocPageController", ['$scope', '$stateParams', 'DocPage', function ($scope, $stateParams, DocPage) {
|
||||
|
||||
// $scope.docPage = $stateParams;
|
||||
$scope.docPage = DocPage.get({page: $stateParams.page});
|
||||
}
|
||||
$scope.docPage = DocPage.get({page: $stateParams.page});
|
||||
|
||||
SwitchThemeCtrl.$inject = ['$scope'];
|
||||
}]);
|
||||
|
||||
// Based off : http://stackoverflow.com/questions/16514330/angularjs-switch-stylesheets-based-on-user-input
|
||||
// Toggle between themes.
|
||||
function SwitchThemeCtrl($scope) {
|
||||
// Based off : http://stackoverflow.com/questions/16514330/angularjs-switch-stylesheets-based-on-user-input
|
||||
rookeriesApp.controller(
|
||||
|
||||
// TODO Consider having an array of themes and switching to the next with a faux-pointer?
|
||||
// TODO Turn the user preferences into a nice model.
|
||||
$scope.user_pref_theme = "daytime";
|
||||
$scope.user_pref_alternative_theme = "evening";
|
||||
"SwitchThemeCtrl", ['$scope', function ($scope) {
|
||||
|
||||
$scope.user_pref_theme_icon_colour = " ";
|
||||
$scope.switchTheme = function() {
|
||||
// TODO Consider having an array of themes and switching to the next with a faux-pointer?
|
||||
// TODO Turn the user preferences into a nice model.
|
||||
$scope.user_pref_theme = "daytime";
|
||||
$scope.user_pref_alternative_theme = "evening";
|
||||
|
||||
if ($scope.user_pref_theme === "daytime") {
|
||||
$scope.user_pref_theme = "evening";
|
||||
$scope.user_pref_alternative_theme = "daytime";
|
||||
$scope.user_pref_theme_icon_colour = "icon-white";
|
||||
} else {
|
||||
$scope.user_pref_theme = "daytime";
|
||||
$scope.user_pref_alternative_theme = "evening";
|
||||
$scope.user_pref_theme_icon_colour = " ";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$scope.user_pref_theme_icon_colour = " ";
|
||||
$scope.switchTheme = function() {
|
||||
|
||||
if ($scope.user_pref_theme === "daytime") {
|
||||
$scope.user_pref_theme = "evening";
|
||||
$scope.user_pref_alternative_theme = "daytime";
|
||||
$scope.user_pref_theme_icon_colour = "icon-white";
|
||||
} else {
|
||||
$scope.user_pref_theme = "daytime";
|
||||
$scope.user_pref_alternative_theme = "evening";
|
||||
$scope.user_pref_theme_icon_colour = " ";
|
||||
}
|
||||
|
||||
}
|
||||
}]);
|
||||
|
||||
//function NavMenuCtrl($scope, DocPage) {
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue