mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Disallow names starting with underscore when saving externalProfile.
This commit is contained in:
parent
abd362f424
commit
0be33856e2
@ -50,7 +50,10 @@ module.controller 'PopupCtrl', ($scope, $window, $q, omegaTarget,
|
||||
omegaTarget.addCondition(condition, profileName).then ->
|
||||
refresh()
|
||||
|
||||
$scope.notConflict = (name) -> not $scope.availableProfiles?['+' + name]
|
||||
$scope.validateProfileName =
|
||||
conflict: '!$value || !availableProfiles["+" + $value]'
|
||||
hidden: '!$value || $value[0] != "_"'
|
||||
|
||||
$scope.saveExternal = ->
|
||||
$scope.nameExternal.open = false
|
||||
name = $scope.externalProfile.name
|
||||
|
@ -37,7 +37,7 @@ html(lang='en' ng-app='omegaPopup' ng-controller='PopupCtrl' ng-csp)
|
||||
= ' '
|
||||
span(ng-show='!nameExternal.open') {{'popup_externalProfile' | tr}}
|
||||
input.form-control(ng-show='!!nameExternal.open' ng-model='externalProfile.name' ng-blur='nameExternalForm.submit()'
|
||||
placeholder='{{"popup_externalProfileName" | tr}}' ui-validate='{conflict: "notConflict($value)"}')
|
||||
placeholder='{{"popup_externalProfileName" | tr}}' ui-validate='validateProfileName')
|
||||
li.divider
|
||||
li.profile(ng-repeat='profile in customProfiles' ng-class='{active: isActive(profile.name), "bg-info": isEffective(profile.name)}')
|
||||
a(ng-click='applyProfile(profile)')
|
||||
|
Loading…
Reference in New Issue
Block a user