Desktop markdown wiki app. Built with node, Electron Framework and AngularJS.

databases-prefs-ctrl.js 967B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @ngdoc function
  3. * @name domainManagerApp.controller:AboutCtrl
  4. * @description
  5. * # AboutCtrl
  6. * Controller of the domainManagerApp
  7. */
  8. angular.module('codexApp.prefs.databases', [])
  9. .controller('DatabasesPrefsCtrl', ['$scope', '$rootScope', '$state', '$location', 'FileService', 'PrefsService', '$timeout', function ($scope, $rootScope, $state, $location, FileService, PrefsService, $timeout) {
  10. console.log("-> Preferences/General");
  11. $scope.notesDir = FileService.getNotesDir();
  12. $scope.changeDir = function(){
  13. dialog.showOpenDialog({ defaultPath: FileService.getNotesDir(), properties: ['openDirectory'] }, function (dir) {
  14. console.log("-> Changin folder location to: " + dir);
  15. FileService.setNotesDir(dir);
  16. if(!$scope.$$phase) {
  17. $scope.$apply(function(){
  18. $scope.notesDir = dir[0];
  19. });
  20. } else {
  21. $scope.notesDir = dir[0];
  22. }
  23. });
  24. }
  25. }]);