Browse Source

Simplify tab logic

adaptive-webui-19844
Thomas Piccirello 6 years ago
parent
commit
86c21baf40
  1. 10
      src/webui/www/private/properties_content.html
  2. 25
      src/webui/www/private/scripts/client.js

10
src/webui/www/private/properties_content.html

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<div id="prop_general">
<div id="prop_general" class="propertiesTabContent">
<fieldset>
<legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
</fieldset>
</div>
<div id="prop_trackers" class="invisible unselectable">
<div id="prop_trackers" class="propertiesTabContent invisible unselectable">
<div id="trackers">
<div id="torrentTrackersTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">
@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
</div>
</div>
<div id="prop_peers" class="invisible unselectable">
<div id="prop_peers" class="propertiesTabContent invisible unselectable">
<div>
<div id="torrentPeersTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
</div>
</div>
<div id="prop_webseeds" class="invisible unselectable">
<div id="prop_webseeds" class="propertiesTabContent invisible unselectable">
<div id="webseeds">
<table class="dynamicTable" style="width: 100%">
<thead>
@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
</div>
</div>
<div id="prop_files" class="invisible unselectable">
<div id="prop_files" class="propertiesTabContent invisible unselectable">
<div id="torrentFiles">
<div id="torrentFilesTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">

25
src/webui/www/private/scripts/client.js

@ -721,51 +721,36 @@ window.addEvent('load', function() { @@ -721,51 +721,36 @@ window.addEvent('load', function() {
};
$('PropGeneralLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_general').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
$('PropTrackersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_trackers').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
$('PropPeersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_peers').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_general').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
$('PropWebSeedsLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_webseeds').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
$('PropFilesLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_files').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

Loading…
Cancel
Save