show only highlighted items. added a link to show all items.

This commit is contained in:
Gustavo Cortez 2014-02-24 02:30:47 -03:00
parent 554356773a
commit 4d5ac130ee
2 changed files with 15 additions and 11 deletions

View File

@ -158,7 +158,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans
if ($routeParams.v_type == '>' || $routeParams.v_type == '<') { if ($routeParams.v_type == '>' || $routeParams.v_type == '<') {
$scope.from_vin = $routeParams.v_type == '<' ? true : false; $scope.from_vin = $routeParams.v_type == '<' ? true : false;
$scope.from_vout = $routeParams.v_type == '>' ? true : false; $scope.from_vout = $routeParams.v_type == '>' ? true : false;
$scope.v_index = $routeParams.v_index; $scope.v_index = parseInt($routeParams.v_index) + 1;
$scope.itemsExpanded = true; $scope.itemsExpanded = true;
} }

View File

@ -51,8 +51,10 @@
</div> </div>
<!-- Full view --> <!-- Full view -->
<div data-ng-if="itemsExpanded" data-ng-init="currentInExpanded=0; sizeInExpanded=5"> <div data-ng-if="itemsExpanded" data-ng-init="currentInExpanded=0; sizeInExpanded=(from_vin && v_index) ? tx.vin.length : 5; fromVinCollapsed=(from_vin && v_index)">
<div data-ng-repeat="vin in tx.vin| startFrom:currentInExpanded*sizeInExpanded | limitTo:sizeInExpanded"> <a href="#" data-ng-show="(from_vin && v_index) && tx.vin.length > 1" data-ng-class="{'text-muted': fromVinCollapsed}" data-ng-click="currentInExpanded=0; sizeInExpanded=tx.vin.length;fromVinCollapsed=1"><small>only highlighted...</small></a>
<a href="#" data-ng-show="(from_vin && v_index) && tx.vin.length > 1" data-ng-class="{'text-muted': !fromVinCollapsed}" data-ng-click="currentInExpanded=0; sizeInExpanded=tx.vin.length;fromVinCollapsed=0"><small>expand all...</small></a>
<div data-ng-repeat="vin in tx.vin| startFrom:currentInExpanded*sizeInExpanded | limitTo:sizeInExpanded" data-ng-if="fromVinCollapsed ? (v_index - 1) == vin.n : 1">
<div class="col-md-12 transaction-vin-vout"> <div class="col-md-12 transaction-vin-vout">
<div class="pull-right btc-value"><p>{{$root.currency.getConvertion(vin.value)}}</p></div> <div class="pull-right btc-value"><p>{{$root.currency.getConvertion(vin.value)}}</p></div>
<div class="ellipsis"> <div class="ellipsis">
@ -68,7 +70,7 @@
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body" style="word-wrap:break-word" data-ng-class="{true: 'v_hightlight', false: ''}[from_vin == true && v_index == vin.n]"> <div class="panel-body" style="word-wrap:break-word" data-ng-class="{true: 'v_hightlight', false: ''}[from_vin == true && (v_index - 1) == vin.n]">
<small> <small>
<strong>scriptSig</strong> <strong>scriptSig</strong>
{{vin.scriptSig.asm}} {{vin.scriptSig.asm}}
@ -77,9 +79,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="showmore_collapse text-right" data-ng-show="tx.vin.length > 5" data-ng-class="{ 'hidden': !itemsExpanded}"> <div class="showmore_collapse text-right" data-ng-show="tx.vin.length > 5 && !fromVinCollapsed" data-ng-class="{ 'hidden': !itemsExpanded}">
<a href="#" ng-hide="sizeInExpanded != tx.vin.length" ng-click="currentInExpanded=0; sizeInExpanded=5"><small>...less</small></a> <a href="#" ng-hide="sizeInExpanded != tx.vin.length" ng-click="currentInExpanded=0; sizeInExpanded=5"><small>...less</small></a>
<a href="#" data-ng-class="{true: 'v_hightlight_more', false: ''}[from_vin == true && v_index > 5]" ng-hide="currentInExpanded >= tx.vin.length/sizeInExpanded - 1" ng-click="currentInExpanded=0; sizeInExpanded=tx.vin.length"><small>more...</small></a> <a href="#" data-ng-class="{true: 'v_hightlight_more', false: ''}[from_vin == true && (v_index - 1) > 5]" ng-hide="currentInExpanded >= tx.vin.length/sizeInExpanded - 1" ng-click="currentInExpanded=0; sizeInExpanded=tx.vin.length"><small>more...</small></a>
</div> </div>
</div> </div>
</div> </div>
@ -120,8 +122,10 @@
</div> </div>
<!-- Full view --> <!-- Full view -->
<div data-ng-if="itemsExpanded" data-ng-init="currentOutExpanded=0; sizeOutExpanded=5"> <div data-ng-if="itemsExpanded" data-ng-init="currentOutExpanded=0; sizeOutExpanded=(from_vout && v_index) ? tx.vout.length : 5; fromVoutCollapsed=(from_vout && v_index)">
<div data-ng-repeat="vout in tx.vout| startFrom:currentOutExpanded*sizeOutExpanded | limitTo:sizeOutExpanded"> <a href="#" data-ng-show="(from_vout && v_index) && tx.vout.length > 1" data-ng-class="{'text-muted': fromVoutCollapsed}" data-ng-click="currentOutExpanded=0; sizeOutExpanded=tx.vout.length;fromVoutCollapsed=1"><small>only highlighted...</small></a>
<a href="#" data-ng-show="(from_vout && v_index) && tx.vout.length > 1" data-ng-class="{'text-muted': !fromVoutCollapsed}" data-ng-click="currentOutExpanded=0; sizeOutExpanded=tx.vout.length;fromVoutCollapsed=0"><small>expand all...</small></a>
<div data-ng-repeat="vout in tx.vout| startFrom:currentOutExpanded*sizeOutExpanded | limitTo:sizeOutExpanded" data-ng-if="fromVoutCollapsed ? (v_index - 1) == vout.n : 1">
<div class="col-md-12 transaction-vin-vout"> <div class="col-md-12 transaction-vin-vout">
<div class="pull-right btc-value"> <div class="pull-right btc-value">
<p>{{$root.currency.getConvertion(vout.value)}} <p>{{$root.currency.getConvertion(vout.value)}}
@ -135,7 +139,7 @@
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body" style="word-wrap:break-word" data-ng-class="{true: 'v_hightlight', false: ''}[from_vout == true && v_index == vout.n]"> <div class="panel-body" style="word-wrap:break-word" data-ng-class="{true: 'v_hightlight', false: ''}[from_vout == true && (v_index - 1) == vout.n]">
<small> <small>
<p> <p>
<strong>Type</strong> <strong>Type</strong>
@ -150,9 +154,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="showmore_collapse text-right" data-ng-show="tx.vout.length > 5" data-ng-class="{ 'hidden': !itemsExpanded}"> <div class="showmore_collapse text-right" data-ng-show="tx.vout.length > 5 && !fromVoutCollapsed" data-ng-class="{ 'hidden': !itemsExpanded}">
<a href="#" ng-hide="sizeOutExpanded != tx.vout.length" ng-click="currentOutExpanded=0; sizeOutExpanded=5"><small>...less</small></a> <a href="#" ng-hide="sizeOutExpanded != tx.vout.length" ng-click="currentOutExpanded=0; sizeOutExpanded=5"><small>...less</small></a>
<a href="#" data-ng-class="{true: 'v_hightlight_more', false: ''}[from_vout == true && v_index > 5]" ng-hide="currentOutExpanded >= tx.vout.length/sizeOutExpanded - 1" ng-click="currentOutExpanded=0; sizeOutExpanded=tx.vout.length"><small>more...</small></a> <a href="#" data-ng-class="{true: 'v_hightlight_more', false: ''}[from_vout == true && (v_index - 1) > 5]" ng-hide="currentOutExpanded >= tx.vout.length/sizeOutExpanded - 1" ng-click="currentOutExpanded=0; sizeOutExpanded=tx.vout.length"><small>more...</small></a>
</div> </div>
</div> </div>
</div> </div>