Hide error message when a tx, addr or block is not found

This commit is contained in:
Mario Colque 2014-02-13 10:57:37 -03:00
parent 96c58157ba
commit 6d222d2fca
5 changed files with 5 additions and 5 deletions

View File

@ -12,6 +12,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Address, getSocket
},
function(address) {
$rootScope.titleDetail = address.addrStr.substring(0,7) + '...';
$rootScope.flashMessage = null;
$scope.address = address;
},
function(e) {

View File

@ -68,6 +68,7 @@ angular.module('insight.blocks').controller('BlocksController',
blockHash: $routeParams.blockHash
}, function(block) {
$rootScope.titleDetail = block.height;
$rootScope.flashMessage = null;
$scope.loading = false;
$scope.block = block;
}, function(e) {

View File

@ -4,7 +4,7 @@ var TRANSACTION_DISPLAYED = 10;
var BLOCKS_DISPLAYED = 5;
angular.module('insight.system').controller('IndexController',
function($scope, $rootScope, Global, getSocket, Blocks) {
function($scope, Global, getSocket, Blocks) {
$scope.global = Global;
var _getBlocks = function() {
@ -19,9 +19,6 @@ angular.module('insight.system').controller('IndexController',
var socket = getSocket($scope);
socket.emit('subscribe', 'inv');
//show errors
$scope.flashMessage = $rootScope.flashMessage || null;
socket.on('tx', function(tx) {
$scope.txs.unshift(tx);
if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) {

View File

@ -112,6 +112,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans
txId: txid
}, function(tx) {
$rootScope.titleDetail = tx.txid.substring(0,7) + '...';
$rootScope.flashMessage = null;
$scope.tx = tx;
_processTX(tx);
$scope.txs.unshift(tx);

View File

@ -1,5 +1,5 @@
<div class="alert alert-danger" data-ng-show="flashMessage">
{{flashMessage}}
{{$root.flashMessage}}
</div>
<div data-ng-include src="'/views/includes/connection.html'"></div>
<section data-ng-controller="IndexController" data-ng-init="index()">