Merge pull request #188 from colkito/feature/new-style-switch

added the style improvement for the currency switch
This commit is contained in:
Gustavo Maximiliano Cortez 2014-02-06 11:02:24 -02:00
commit 21caa38ccb
5 changed files with 11 additions and 13 deletions

View File

@ -40,11 +40,6 @@ exports.index = function(req, res) {
// Init // Init
var currentTime = +new Date(); var currentTime = +new Date();
console.log('-----------------------------------');
console.log(timestamp);
console.log(currentTime);
console.log(currentTime >= (timestamp + delay));
console.log('-----------------------------------');
if (bitstampRate === 0 || currentTime >= (timestamp + delay)) { if (bitstampRate === 0 || currentTime >= (timestamp + delay)) {
timestamp = currentTime; timestamp = currentTime;

View File

@ -277,8 +277,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
height: 51px; height: 51px;
overflow: hidden; overflow: hidden;
} }
#footer .currency a.active {
#footer .currency a:active {
color: #fff; color: #fff;
text-decoration: underline; text-decoration: underline;
} }

View File

@ -39,7 +39,7 @@ angular.module('insight.system').controller('FooterController',
$scope.setCurrency = function(currency) { $scope.setCurrency = function(currency) {
if (currency === 'USD') { if (currency === 'USD') {
Currency.get({}, function(res) { Currency.get({}, function(res) {
$rootScope.currency.factor = res.data.bitstamp; $rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp;
}); });
} else if (currency === 'mBTC') { } else if (currency === 'mBTC') {
$rootScope.currency.factor = 1000; $rootScope.currency.factor = 1000;

View File

@ -4,7 +4,9 @@ angular.module('insight.system').controller('HeaderController',
function($scope, $rootScope, getSocket, Global, Block, Currency) { function($scope, $rootScope, getSocket, Global, Block, Currency) {
$scope.global = Global; $scope.global = Global;
Currency.get(); Currency.get({}, function(res) {
$rootScope.currency.bitstamp = res.data.bitstamp;
});
$scope.menu = [ $scope.menu = [
{ {

View File

@ -1,9 +1,11 @@
<div class="container" data-ng-controller="FooterController"> <div class="container" data-ng-controller="FooterController">
<div class="pull-left m10v currency"> <div class="pull-left m10v currency">
<small>Currency:</small> <small>
<a href="#" data-ng-click="setCurrency('USD')">USD</a> - Currency:
<a href="#" data-ng-click="setCurrency('BTC')">BTC</a> - <a href="#" data-ng-click="setCurrency('USD')" data-ng-class="{active: $root.currency.symbol == 'USD'}" tooltip="Change to USD: Bitstamp ${{$root.currency.bitstamp}}">USD</a> ·
<a href="#" data-ng-click="setCurrency('mBTC')">mBTC</a> <a href="#" data-ng-click="setCurrency('BTC')" data-ng-class="{active: $root.currency.symbol == 'BTC'}" tooltip="Change to BTC">BTC</a> ·
<a href="#" data-ng-click="setCurrency('mBTC')" data-ng-class="{active: $root.currency.symbol == 'mBTC'}" tooltip="Change to mBTC">mBTC</a>
</small>
</div> </div>
<a class="insight m10v pull-right" href="/">Insight <small>API v{{version}}</small></a> <a class="insight m10v pull-right" href="/">Insight <small>API v{{version}}</small></a>
</div> </div>