From 50fad9473cd8cfbc1b1bc616a9060aab7d8a0322 Mon Sep 17 00:00:00 2001 From: Freek Date: Thu, 19 May 2016 19:19:45 +0200 Subject: [PATCH 1/2] Icon button enabling switching of quote and base currency --- frontend/client/style/index.css | 6 ++++++ frontend/client/templates/currencyselector.html | 8 ++++---- frontend/client/templates/currencyselector.js | 9 +++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/frontend/client/style/index.css b/frontend/client/style/index.css index 5920ac1..b14ac7f 100644 --- a/frontend/client/style/index.css +++ b/frontend/client/style/index.css @@ -104,3 +104,9 @@ h1 img { margin-left: -1.2rem } section { float: right; width: 48% } section:first-of-type { float: left } } + +#spnSwitchCurrencies { + margin: 0px 10px; + vertical-align: middle; + cursor: pointer; +} \ No newline at end of file diff --git a/frontend/client/templates/currencyselector.html b/frontend/client/templates/currencyselector.html index d999959..ae3fc91 100644 --- a/frontend/client/templates/currencyselector.html +++ b/frontend/client/templates/currencyselector.html @@ -1,12 +1,12 @@ diff --git a/frontend/client/templates/currencyselector.js b/frontend/client/templates/currencyselector.js index 3cda711..751a105 100644 --- a/frontend/client/templates/currencyselector.js +++ b/frontend/client/templates/currencyselector.js @@ -47,3 +47,12 @@ Template.currencySelector.viewmodel({ }) } }) + +Template.currencySelector.events({ + 'click #spnSwitchCurrencies': function() { + var quoteCurrency = Session.get('quoteCurrency'); + var baseCurrency = Session.get('baseCurrency'); + Session.set('quoteCurrency', baseCurrency); + Session.set('baseCurrency', quoteCurrency); + } +}) From 28b341a64fefef7d08830f95a6bde99e09cc7b0e Mon Sep 17 00:00:00 2001 From: Freek Date: Fri, 20 May 2016 01:18:17 +0200 Subject: [PATCH 2/2] Removal of semicolons --- frontend/client/templates/currencyselector.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/client/templates/currencyselector.js b/frontend/client/templates/currencyselector.js index 751a105..12aa7ca 100644 --- a/frontend/client/templates/currencyselector.js +++ b/frontend/client/templates/currencyselector.js @@ -49,10 +49,10 @@ Template.currencySelector.viewmodel({ }) Template.currencySelector.events({ - 'click #spnSwitchCurrencies': function() { - var quoteCurrency = Session.get('quoteCurrency'); - var baseCurrency = Session.get('baseCurrency'); - Session.set('quoteCurrency', baseCurrency); - Session.set('baseCurrency', quoteCurrency); + 'click #spnSwitchCurrencies': function () { + var quoteCurrency = Session.get('quoteCurrency') + var baseCurrency = Session.get('baseCurrency') + Session.set('quoteCurrency', baseCurrency) + Session.set('baseCurrency', quoteCurrency) } })