added the style improvement for the currency switch

This commit is contained in:
Mario Colque 2014-02-06 04:46:50 -03:00
parent 9598e199ae
commit afec679720
5 changed files with 11 additions and 13 deletions

View File

@ -40,11 +40,6 @@ exports.index = function(req, res) {
// Init
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)) {
timestamp = currentTime;

View File

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

View File

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

View File

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

View File

@ -1,9 +1,11 @@
<div class="container" data-ng-controller="FooterController">
<div class="pull-left m10v currency">
<small>Currency:</small>
<a href="#" data-ng-click="setCurrency('USD')">USD</a> -
<a href="#" data-ng-click="setCurrency('BTC')">BTC</a> -
<a href="#" data-ng-click="setCurrency('mBTC')">mBTC</a>
<small>
Currency:
<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('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>
<a class="insight m10v pull-right" href="/">Insight <small>API v{{version}}</small></a>
</div>