Browse Source

fix(gui): reflect folder password visibility by changing button icon (#9857)

Make the "toggle password visibility" button on encrypted
folders change its icon from `fa-eye` to `fa-eye-slash` while the
password is visible.
Alex Ionescu 10 months ago
parent
commit
479c0d3f16

+ 1 - 1
gui/default/syncthing/core/editShareTemplate.html

@@ -36,7 +36,7 @@
     </span>
     <span ng-switch="selected[id] && folderType !== 'receiveencrypted'" class="input-group-addon">
       <span ng-switch-when='true'>
-        <span class="button fas fa-fw fa-eye" ng-click="togglePasswordVisibility()"></span>
+        <span class="button fas fa-fw {{plain ? 'fa-eye-slash' : 'fa-eye'}}" ng-click="togglePasswordVisibility()"></span>
       </span>
       <span ng-switch-default>
         <span class="button fas fa-fw fa-eye" disabled></span>

+ 0 - 1
gui/default/syncthing/core/syncthingController.js

@@ -3703,7 +3703,6 @@ angular.module('syncthing.core')
                 untrusted: '=',
             },
             link: function (scope, elem, attrs) {
-                var plain = false;
                 scope.togglePasswordVisibility = function() {
                     scope.plain = !scope.plain;
                 };