From 6b0fac12dbe4d16e5ca4ba96f5d65fa94235acc6 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Mon, 8 Oct 2018 09:45:59 -0400 Subject: [PATCH] Added a button to swap the current to/from selection --- index.html | 1 + tcresearch.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 880d9238..d67a924f 100644 --- a/index.html +++ b/index.html @@ -33,6 +33,7 @@

Thaumcraft 4.x-5.x Research Helper

From: To: + Min. Steps: Addons: diff --git a/tcresearch.js b/tcresearch.js index 4c1dea76..3e4d04c4 100644 --- a/tcresearch.js +++ b/tcresearch.js @@ -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 @@ -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(); });