From 39f3fed97a664be760731ba450d2acd249faa6cf Mon Sep 17 00:00:00 2001 From: Satinder Grewal Date: Thu, 26 Jan 2017 16:34:55 +1300 Subject: [PATCH] Addcoin selection conditions added to activate appropriate mode as per coin selected --- assets/scripts/dashboard.js | 30 ++++++++++++++++++++++++------ assets/scripts/login.js | 21 +++++++++++++++++++-- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js index e9b440d..77b7597 100644 --- a/assets/scripts/dashboard.js +++ b/assets/scripts/dashboard.js @@ -306,17 +306,35 @@ var Dashboard = function() { var handleWalletWidgetBtns = function() { $('#addcoin_mdl_native_mode').prop('disabled', true); - + $('#addcoin_mdl_basilisk_mode').prop('disabled', true); + $('#addcoin_mdl_full_mode').prop('disabled', true); + $('#addcoin_mdl_full_mode').prop("checked", false); + $('.mdl_addcoin_done_btn').click(function(){ ExecuteAddCoinFn(); }); $( "#addcoin_select_coin_mdl_options" ).change(function() { - if ($('#addcoin_select_coin_mdl_options').val() == 'KMD') { - $('#addcoin_mdl_native_mode').prop('disabled', false); - } else { - $('#addcoin_mdl_native_mode').prop('disabled', true); - } + var tmp_coin_val = $('#addcoin_select_coin_mdl_options').val() + + if (tmp_coin_val !== 'KMD' || tmp_coin_val !== 'KMD' ) { + $('#addcoin_mdl_native_mode').prop('disabled', true); + $('#addcoin_mdl_basilisk_mode').prop('disabled', true); + $('#addcoin_mdl_full_mode').prop('disabled', false); + $('#addcoin_mdl_full_mode').prop("checked", true); + } + if (tmp_coin_val == 'KMD') { + $('#addcoin_mdl_native_mode').prop('disabled', false); + $('#addcoin_mdl_basilisk_mode').prop('disabled', false); + $('#addcoin_mdl_full_mode').prop('disabled', false); + $('#addcoin_mdl_full_mode').prop("checked", true); + } + if (tmp_coin_val == 'BTC') { + $('#addcoin_mdl_basilisk_mode').prop('disabled', false); + $('#addcoin_mdl_native_mode').prop('disabled', true); + $('#addcoin_mdl_full_mode').prop('disabled', false); + $('#addcoin_mdl_full_mode').prop("checked", true); + } }); } diff --git a/assets/scripts/login.js b/assets/scripts/login.js index 8e58494..84b8781 100644 --- a/assets/scripts/login.js +++ b/assets/scripts/login.js @@ -742,16 +742,33 @@ var Login = function() { var handleAddCoinLoginBtn = function() { $('#addcoin_mdl_native_mode_login').prop('disabled', true); + $('#addcoin_mdl_basilisk_mode_login').prop('disabled', true); + $('#addcoin_mdl_full_mode_login').prop('disabled', true); + $('#addcoin_mdl_full_mode_login').prop("checked", false); $('.mdl_addcoin_done_btn-login').click(function(){ ExecuteAddCoinLoginFn(); }); $( "#addcoin_select_coin_mdl_options-login" ).change(function() { - if ($('#addcoin_select_coin_mdl_options-login').val() == 'KMD') { + var tmp_coin_val = $('#addcoin_select_coin_mdl_options-login').val() + if (tmp_coin_val !== 'KMD' || tmp_coin_val !== 'KMD' ) { + $('#addcoin_mdl_native_mode_login').prop('disabled', true); + $('#addcoin_mdl_basilisk_mode_login').prop('disabled', true); + $('#addcoin_mdl_full_mode_login').prop('disabled', false); + $('#addcoin_mdl_full_mode_login').prop("checked", true); + } + if (tmp_coin_val == 'KMD') { $('#addcoin_mdl_native_mode_login').prop('disabled', false); - } else { + $('#addcoin_mdl_basilisk_mode_login').prop('disabled', false); + $('#addcoin_mdl_full_mode_login').prop('disabled', false); + $('#addcoin_mdl_full_mode_login').prop("checked", true); + } + if (tmp_coin_val == 'BTC') { + $('#addcoin_mdl_basilisk_mode_login').prop('disabled', false); $('#addcoin_mdl_native_mode_login').prop('disabled', true); + $('#addcoin_mdl_full_mode_login').prop('disabled', false); + $('#addcoin_mdl_full_mode_login').prop("checked", true); } }); }