GUI Rework: reorganized folders and split app.js

This commit is contained in:
Dennis Wilson
2014-11-26 13:39:59 +01:00
committed by Jakob Borg
parent 8588625937
commit 3b88ee623b
52 changed files with 1591 additions and 1502 deletions

View File

@@ -0,0 +1,21 @@
angular.module('syncthing.core')
.directive('uniqueFolder', function () {
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function (viewValue) {
if (scope.editingExisting) {
// we shouldn't validate
ctrl.$setValidity('uniqueFolder', true);
} else if (scope.folders[viewValue]) {
// the folder exists already
ctrl.$setValidity('uniqueFolder', false);
} else {
// the folder is unique
ctrl.$setValidity('uniqueFolder', true);
}
return viewValue;
});
}
};
});