From b686174b07bd56af4e5ffaa23c24f27f417fc305 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 19 Feb 2023 16:05:52 +0100 Subject: Merging upstream version 2.1.1 (Closes: #1026291). Signed-off-by: Daniel Baumann --- deluge/ui/web/js/deluge-all/add/OptionsPanel.js | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'deluge/ui/web/js/deluge-all/add/OptionsPanel.js') diff --git a/deluge/ui/web/js/deluge-all/add/OptionsPanel.js b/deluge/ui/web/js/deluge-all/add/OptionsPanel.js index 3dfb6f8..365b001 100644 --- a/deluge/ui/web/js/deluge-all/add/OptionsPanel.js +++ b/deluge/ui/web/js/deluge-all/add/OptionsPanel.js @@ -18,7 +18,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { activeTab: 0, height: 265, - initComponent: function() { + initComponent: function () { Deluge.add.OptionsPanel.superclass.initComponent.call(this); this.files = this.add(new Deluge.add.FilesTab()); this.form = this.add(new Deluge.add.OptionsTab()); @@ -26,12 +26,12 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { this.files.on('fileschecked', this.onFilesChecked, this); }, - addTorrent: function(torrent) { + addTorrent: function (torrent) { this.torrents[torrent['info_hash']] = torrent; var fileIndexes = {}; this.walkFileTree( torrent['files_tree'], - function(filename, type, entry, parent) { + function (filename, type, entry, parent) { if (type != 'file') return; fileIndexes[entry.index] = entry.download; }, @@ -39,7 +39,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { ); var priorities = []; - Ext.each(Ext.keys(fileIndexes), function(index) { + Ext.each(Ext.keys(fileIndexes), function (index) { priorities[index] = fileIndexes[index]; }); @@ -51,26 +51,26 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { this.form.optionsManager.changeId(oldId, true); }, - clear: function() { + clear: function () { this.files.clearFiles(); this.form.optionsManager.resetAll(); }, - getFilename: function(torrentId) { + getFilename: function (torrentId) { return this.torrents[torrentId]['filename']; }, - getOptions: function(torrentId) { + getOptions: function (torrentId) { var oldId = this.form.optionsManager.changeId(torrentId, true); var options = this.form.optionsManager.get(); this.form.optionsManager.changeId(oldId, true); - Ext.each(options['file_priorities'], function(priority, index) { + Ext.each(options['file_priorities'], function (priority, index) { options['file_priorities'][index] = priority ? 1 : 0; }); return options; }, - setTorrent: function(torrentId) { + setTorrent: function (torrentId) { if (!torrentId) return; this.torrentId = torrentId; @@ -85,7 +85,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { if (this.torrents[torrentId]['files_tree']) { this.walkFileTree( this.torrents[torrentId]['files_tree'], - function(filename, type, entry, parentNode) { + function (filename, type, entry, parentNode) { var node = new Ext.tree.TreeNode({ download: entry.index ? priorities[entry.index] : true, filename: filename, @@ -109,7 +109,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { } }, - walkFileTree: function(files, callback, scope, parentNode) { + walkFileTree: function (files, callback, scope, parentNode) { for (var filename in files.contents) { var entry = files.contents[filename]; var type = entry.type; @@ -129,14 +129,13 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { } }, - onFilesChecked: function(nodes, newValue, oldValue) { + onFilesChecked: function (nodes, newValue, oldValue) { Ext.each( nodes, - function(node) { + function (node) { if (node.attributes.fileindex < 0) return; - var priorities = this.form.optionsManager.get( - 'file_priorities' - ); + var priorities = + this.form.optionsManager.get('file_priorities'); priorities[node.attributes.fileindex] = newValue; this.form.optionsManager.update('file_priorities', priorities); }, -- cgit v1.2.3