mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 10:40:12 +00:00
34 lines
836 B
JavaScript
34 lines
836 B
JavaScript
/**
|
|
* @ngdoc function
|
|
* @name superProductivity.controller:CreateProjectCtrl
|
|
* @description
|
|
* # CreateProjectCtrl
|
|
* Controller of the superProductivity
|
|
*/
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
angular
|
|
.module('superProductivity')
|
|
.controller('CreateProjectCtrl', CreateProjectCtrl);
|
|
|
|
/* @ngInject */
|
|
function CreateProjectCtrl($mdDialog, Projects, SimpleToast, IS_ELECTRON, $localStorage) {
|
|
let vm = this;
|
|
vm.IS_ELECTRON = IS_ELECTRON;
|
|
vm.task = {};
|
|
vm.projectSettings = {};
|
|
vm.projectSettings.theme = $localStorage.theme;
|
|
|
|
vm.createProject = (project) => {
|
|
Projects.createNew(project.title, vm.projectSettings);
|
|
SimpleToast('SUCCESS', 'You created the project "' + project.title + '"');
|
|
$mdDialog.hide();
|
|
};
|
|
|
|
vm.cancel = () => {
|
|
$mdDialog.hide();
|
|
};
|
|
}
|
|
})();
|