From b8df55f458a562133639e36cfd4fdb6b613b1d16 Mon Sep 17 00:00:00 2001 From: Josh Jeffryes Date: Mon, 27 Jun 2016 17:23:28 -0400 Subject: [PATCH] Remove CoinKite Wallet - removes the no longer supported CoinKite wallet - fixes the randomization code - Closes #1725 --- js/templates/buyWizard.html | 18 ------------------ js/views/buyWizardVw.js | 24 +++++++----------------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/js/templates/buyWizard.html b/js/templates/buyWizard.html index 6322a310b..d8df6c5c0 100644 --- a/js/templates/buyWizard.html +++ b/js/templates/buyWizard.html @@ -210,24 +210,6 @@

<%= polyglot.t('buyFlow.HaveWallet') %>

- -
-
- - - -
-
-
-
- Coinkite - <%= polyglot.t('walletProviders.WalletOnly') %> -
-
<%= polyglot.t('walletProviders.CoinkiteTagline') %>
-
-
-
-
diff --git a/js/views/buyWizardVw.js b/js/views/buyWizardVw.js index 3244ee679..9ed48a34b 100644 --- a/js/views/buyWizardVw.js +++ b/js/views/buyWizardVw.js @@ -14,20 +14,6 @@ var __ = require('underscore'), clipboard = require('clipboard'), templateHelpers = require('../utils/templateHelpers'); -// randomize function -$.fn.randomize = function(selector){ - var $elems = selector ? $(this).find(selector) : $(this).children(), - $parents = $elems.parent(); - - $parents.each(function(){ - $(this).children(selector).sort(function(){ - return Math.round(Math.random()) - 0.5; - }).detach().appendTo(this); - }); - - return this; -}; - module.exports = baseModal.extend({ className: "buyView custCol-text insideApp", @@ -220,9 +206,13 @@ module.exports = baseModal.extend({ //auto select first payment type self.$el.find("input:radio[name=radioPaymentType]:first").attr('checked', true).trigger('click'); - //randomize the bitcoin wallet providers 5 times - for (var i = 0; i < 5; i++) { - $(".js-BuyWizardWallets").randomize(); + //randomize the bitcoin wallet providers + + let $allWallets = self.$(".js-BuyWizardWallets"); + let wallets = $allWallets.children('.js-bitcoinWalletProvider'); + + while (wallets.length){ + $allWallets.append(wallets.splice(Math.floor(Math.random() * wallets.length), 1)[0]); } //set the QR details checkbox