mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 02:18:44 -07:00
gui: Restore Select / Deselect All buttons in device sharing tab. (#7161)
This fixes a regression by restoring two functions removed in commit
a20d85d451
, 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
bbb22c8c80
commit
ab53687c38
@ -1438,6 +1438,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…
Reference in New Issue
Block a user