Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Added a button to swap the current to/from selection #54

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ <h2>Thaumcraft 4.x-5.x Research Helper</h2>
</tr>
<tr><td>From:</td><td><input type=hidden id="fromSel"></input></td></tr>
<tr><td>To:</td><td><input type=hidden id="toSel"></input></td></tr>
<tr><td><input id="swap_selections" type="button" value="Swap"/></td></tr>
<tr><td>Min. Steps:</td><td><input id="spinner" name="value" value="1" style="width:140px" /></td></tr>
<tr><td></td><td><input id="find_connection" type="button" value="Find Connection" /><input id="close_results" type="button" value="Close all results" /></td></tr>
<tr><td>Addons:</td><td id="addons"></td></tr>
Expand Down
7 changes: 6 additions & 1 deletion tcresearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ $(function(){
option.textContent = text;
return option;
}

function formatAspectName(string)
{
//http://stackoverflow.com/a/1026087 Capitalize the first letter of string in JavaScript
Expand All @@ -99,6 +98,12 @@ $(function(){
max: 10
});
reset_aspects();
$('#swap_selections').click(function(){
var fromSel = $('#fromSel').select2("val");
var toSel = $('#toSel').select2("val");
$('#fromSel').select2('val', toSel);
$('#toSel').select2('val', fromSel);
});
$("#find_connection").click(function(){
run();
});
Expand Down