mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-02 15:51:51 +00:00
gui: Restore Select / Deselect All buttons in device sharing tab. (#7161)
This fixes a regression by restoring two functions removed in commit a20d85d451fcce63d94b6d8c40de65d4db3c7bd9, but still used from the HTML template. Adjust the restored versions to access the new flag storage structure. The replacement functions selectAllSharedFolders() and selectAllUnrelatedFolders() are not functional, so this is just a quick fix to restore a working state before making the new functions actually work sensibly. Just like the respective functions for sharing device selections, give it a boolean argument instead of writing two almost identical functions. In line with the other selectAll...() functions, avoid calling angular.forEach() and iterate over the folders object directly.
This commit is contained in:
parent
dcddd9c1e4
commit
b16cc72fc7
@ -1416,6 +1416,13 @@ angular.module('syncthing.core')
|
||||
$('#editDevice').modal();
|
||||
};
|
||||
|
||||
$scope.selectAllFolders = function (state) {
|
||||
var folders = $scope.folders;
|
||||
for (var id in folders) {
|
||||
$scope.currentSharing.selected[id] = !!state;
|
||||
};
|
||||
};
|
||||
|
||||
$scope.selectAllSharedFolders = function (state) {
|
||||
var devices = $scope.currentSharing.shared;
|
||||
for (var i = 0; i < devices.length; i++) {
|
||||
|
@ -69,8 +69,8 @@
|
||||
<label translate for="folders">Share Folders With Device</label>
|
||||
<p class="help-block">
|
||||
<span translate>Select the folders to share with this device.</span> 
|
||||
<small><a href="#" ng-click="selectAllFolders()" translate>Select All</a> 
|
||||
<a href="#" ng-click="deSelectAllFolders()" translate>Deselect All</a></small>
|
||||
<small><a href="#" ng-click="selectAllFolders(true)" translate>Select All</a> 
|
||||
<a href="#" ng-click="selectAllFolders(false)" translate>Deselect All</a></small>
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col-md-4" ng-repeat="folder in folderList()">
|
||||
|
Loading…
x
Reference in New Issue
Block a user