mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-08-01 04:01:01 +00:00
improve import for new projects model
This commit is contained in:
parent
e97e902581
commit
2df609e654
3 changed files with 26 additions and 9 deletions
|
|
@ -8,15 +8,19 @@
|
|||
aria-label="cloud"></ng-md-icon>
|
||||
</md-button>
|
||||
|
||||
|
||||
<md-select ng-model="vm.r.currentProject"
|
||||
arial-label="Select Project">
|
||||
<md-option ng-repeat="project in vm.allProjects"
|
||||
arial-label="Select Project"
|
||||
ng-value="project">
|
||||
{{project.title}}
|
||||
</md-option>
|
||||
</md-select>
|
||||
<md-menu ng-if="vm.r.currentProject">
|
||||
<md-button aria-label="Open phone interactions menu"
|
||||
ng-click="vm.openMenu($mdOpenMenu, $event)">
|
||||
{{ vm.r.currentProject.title }}
|
||||
</md-button>
|
||||
<md-menu-content width="4">
|
||||
<md-menu-item ng-repeat="project in vm.allProjects">
|
||||
<md-button ng-click="vm.r.currentProject = project">
|
||||
{{project.title}}
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
|
||||
<h2 ng-if="!vm.r.currentProject">
|
||||
<a ui-sref="daily-planner">SuperProductivity</a>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@
|
|||
|
||||
vm.allProjects = Projects.getList();
|
||||
|
||||
|
||||
this.openMenu = function($mdOpenMenu, ev) {
|
||||
$mdOpenMenu(ev);
|
||||
};
|
||||
|
||||
vm.openAddTask = () => {
|
||||
Dialogs('ADD_TASK');
|
||||
};
|
||||
|
|
|
|||
|
|
@ -50,6 +50,14 @@
|
|||
$rootScope.r[key] = $localStorage[key] = val;
|
||||
});
|
||||
|
||||
// delete projects and current project if there are non yet
|
||||
if (!settings.currentProject) {
|
||||
$localStorage.currentProject = $rootScope.r.currentProject = undefined;
|
||||
}
|
||||
if (!settings.projects) {
|
||||
$localStorage.projects = $rootScope.r.projects = [];
|
||||
}
|
||||
|
||||
$mdToast.show($mdToast.simple()
|
||||
.textContent('Settings successfully imported')
|
||||
.position('bottom'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue