]> granicus.if.org Git - transmission/commitdiff
(trunk web) Remove the "inspector is open" cookie. It doesn't make sense for the...
authorJordan Lee <jordan@transmissionbt.com>
Tue, 30 Aug 2011 04:54:37 +0000 (04:54 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 30 Aug 2011 04:54:37 +0000 (04:54 +0000)
web/javascript/common.js
web/javascript/transmission.js

index afb8858f5ee1c9592224d5447bac21d0e81d7268..ce473bbbc1ffa78b3a575a84df32a1398508ca85 100644 (file)
@@ -148,8 +148,6 @@ Prefs.prototype = { };
 Prefs._RefreshRate        = 'refresh_rate';
 Prefs._SessionRefreshRate = 'session_refresh_rate';
 
-Prefs._ShowInspector      = 'show_inspector';
-
 Prefs._FilterMode         = 'filter';
 Prefs._FilterAll          = 'all';
 Prefs._FilterActive       = 'active';
@@ -179,7 +177,6 @@ Prefs._Defaults =
        'filter': 'all',
        'refresh_rate' : 5,
        'show_filter': true,
-       'show_inspector': false,
        'sort_direction': 'ascending',
        'sort_method': 'name',
        'turtle-state' : false,
index d4a9559fc05cf7eed088d220ce3cf4bcfdddf273..02b68ea88a9adf34bd92a4bd55c0953bdea3a2dc 100644 (file)
@@ -219,9 +219,6 @@ Transmission.prototype =
 
                        if (this[Prefs._SortDirection] === Prefs._SortDescending)
                                $('#reverse_sort_order').selectMenuItem();
-
-                       if (this[Prefs._ShowInspector])
-                               this.setInspectorVisible(true);
                }
 
                this.initCompactMode();
@@ -447,7 +444,7 @@ Transmission.prototype =
 
        selectionChanged: function()
        {
-               if (this[Prefs._ShowInspector])
+               if (this.inspectorIsVisible())
                        this.refreshInspectorTorrents();
 
                this.updateButtonStates();
@@ -1019,9 +1016,8 @@ Transmission.prototype =
                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)
@@ -1092,7 +1088,7 @@ Transmission.prototype =
        {
                // 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);
@@ -1426,6 +1422,10 @@ Transmission.prototype =
        *****
        ****/
 
+       inspectorIsVisible: function() {
+               return $('#torrent_inspector').is(':visible');
+       },
+
        filesSelectAllClicked: function() {
                var t = this._file_torrent;
                if (t)
@@ -1467,7 +1467,7 @@ Transmission.prototype =
         */
        updateInspector: function()
        {
-               if (!this[Prefs._ShowInspector])
+               if (!this.inspectorIsVisible())
                        return;
 
                var torrents = this.getSelectedTorrents();
@@ -1832,7 +1832,7 @@ Transmission.prototype =
 
        toggleInspector: function()
        {
-               this.setInspectorVisible(!this[Prefs._ShowInspector]);
+               this.setInspectorVisible(!this.inspectorIsVisible());
        },
        setInspectorVisible: function(visible)
        {
@@ -1857,9 +1857,7 @@ Transmission.prototype =
                }
 
                setInnerHTML($('ul li#context_toggle_inspector')[0], (visible?'Hide':'Show')+' Inspector');
-               this.setPref(Prefs._ShowInspector, visible);
-               if (visible)
-                       this.updateInspector();
+               this.updateInspector();
        },
 
        /****