Prefs._RefreshRate = 'refresh_rate';
Prefs._SessionRefreshRate = 'session_refresh_rate';
-Prefs._ShowInspector = 'show_inspector';
-
Prefs._FilterMode = 'filter';
Prefs._FilterAll = 'all';
Prefs._FilterActive = 'active';
'filter': 'all',
'refresh_rate' : 5,
'show_filter': true,
- 'show_inspector': false,
'sort_direction': 'ascending',
'sort_method': 'name',
'turtle-state' : false,
if (this[Prefs._SortDirection] === Prefs._SortDescending)
$('#reverse_sort_order').selectMenuItem();
-
- if (this[Prefs._ShowInspector])
- this.setInspectorVisible(true);
}
this.initCompactMode();
selectionChanged: function()
{
- if (this[Prefs._ShowInspector])
+ if (this.inspectorIsVisible())
this.refreshInspectorTorrents();
this.updateButtonStates();
this.updateButtonsSoon();
// if this torrent is in the inspector, refresh the inspector
- if (this[Prefs._ShowInspector])
- if (this.getSelectedTorrentIds().indexOf(id) !== -1)
- this.updateInspector();
+ if (this.getSelectedTorrentIds().indexOf(id) !== -1)
+ this.updateInspector();
},
updateFromTorrentGet: function(updates, removed_ids)
{
// some torrent fields are only used by the inspector, so we defer loading them
// until the user is viewing the torrent in the inspector.
- if ($('#torrent_inspector').is(':visible')) {
+ if (this.inspectorIsVisible()) {
var ids = this.getSelectedTorrentIds();
if (ids && ids.length) {
var fields = ['id'].concat(Torrent.Fields.StatsExtra);
*****
****/
+ inspectorIsVisible: function() {
+ return $('#torrent_inspector').is(':visible');
+ },
+
filesSelectAllClicked: function() {
var t = this._file_torrent;
if (t)
*/
updateInspector: function()
{
- if (!this[Prefs._ShowInspector])
+ if (!this.inspectorIsVisible())
return;
var torrents = this.getSelectedTorrents();
toggleInspector: function()
{
- this.setInspectorVisible(!this[Prefs._ShowInspector]);
+ this.setInspectorVisible(!this.inspectorIsVisible());
},
setInspectorVisible: function(visible)
{
}
setInnerHTML($('ul li#context_toggle_inspector')[0], (visible?'Hide':'Show')+' Inspector');
- this.setPref(Prefs._ShowInspector, visible);
- if (visible)
- this.updateInspector();
+ this.updateInspector();
},
/****