mirror of
https://github.com/Tailszefox/Pony-Fusion.git
synced 2024-11-27 07:57:58 +01:00
Prevent user from making a fusion with the same pony
This commit is contained in:
parent
d08e973ba6
commit
180a41ce16
1 changed files with 15 additions and 0 deletions
15
index.php
15
index.php
|
@ -186,8 +186,17 @@ else
|
||||||
|
|
||||||
function getNewFusion()
|
function getNewFusion()
|
||||||
{
|
{
|
||||||
|
$("#to").find("option").removeAttr("disabled");
|
||||||
|
$("#from").find("option").removeAttr("disabled");
|
||||||
|
|
||||||
var from = $("#from").val();
|
var from = $("#from").val();
|
||||||
var to = $("#to").val();
|
var to = $("#to").val();
|
||||||
|
var fromSelected = $("#from")[0].selectedIndex;
|
||||||
|
var toSelected = $("#to")[0].selectedIndex;
|
||||||
|
|
||||||
|
$("#to")[0].options[fromSelected].disabled = true;
|
||||||
|
|
||||||
|
$("#from")[0].options[toSelected].disabled = true;
|
||||||
|
|
||||||
jQuery.get('fusion_ajax.php', {from: from, to: to}, function(data, textStatus, xhr) {
|
jQuery.get('fusion_ajax.php', {from: from, to: to}, function(data, textStatus, xhr) {
|
||||||
$("#resultDivContent").html(data);
|
$("#resultDivContent").html(data);
|
||||||
|
@ -197,6 +206,9 @@ else
|
||||||
|
|
||||||
function randomizePonies(which)
|
function randomizePonies(which)
|
||||||
{
|
{
|
||||||
|
$("#to").find("option").removeAttr("disabled");
|
||||||
|
$("#from").find("option").removeAttr("disabled");
|
||||||
|
|
||||||
var nbPonies = $("#from option").size();
|
var nbPonies = $("#from option").size();
|
||||||
|
|
||||||
if(which == 0)
|
if(which == 0)
|
||||||
|
@ -245,6 +257,9 @@ else
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#buttonSwap").click(function (e) {
|
$("#buttonSwap").click(function (e) {
|
||||||
|
$("#to").find("option").removeAttr("disabled");
|
||||||
|
$("#from").find("option").removeAttr("disabled");
|
||||||
|
|
||||||
var from = $("#from").val();
|
var from = $("#from").val();
|
||||||
var to = $("#to").val();
|
var to = $("#to").val();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue