Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
add option to hide tx feed
Browse files Browse the repository at this point in the history
  • Loading branch information
shekenahglory committed Jun 7, 2016
1 parent bf55977 commit 0553c3f
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/app/transactions/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ angular.module( 'ripplecharts.transactions', [
$scope.tx_hash = $scope.input_tx_hash;
};

$scope.toggleFeed = function () {
$scope.feedHidden = !$scope.feedHidden;
$scope.toggleText = $scope.feedHidden ? 'Show Feed' : 'X';
store.set('feedHidden', $scope.feedHidden);
};

$scope.feedHidden = !(store.get('feedHidden') || false);
$scope.toggleFeed();

function handleTransition(hash) {
if (hash) {
$state.transitionTo('transactions.tx_hash', {
Expand Down
85 changes: 83 additions & 2 deletions src/app/transactions/transactions.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,61 @@
.transactions .column1 {
width: 350px;
max-width: 350px;
transition: width .5s ease;
}

.transactions .column2 {
width: 100%;
}

.transactions .column1 .toggle {
position: relative;
z-index: 1;
background: #fff;
overflow: hidden;
transition: width .5s ease;
width: 350px;
}

.transactions .column1 .toggle span {
float: right;
padding: 3px 6px;
border: 1px solid #eee;
cursor: pointer;
display: block;
text-align: center;
font-weight: bold;
font-size: 10px;
}

.transactions .column1 .toggle span:hover {
background-color: #eee;
border-color: #ddd;
}

.transactions .column.feedHidden {
width: 0;
transition: width .5s ease;
}

.transactions .column.feedHidden .toggle {
position:fixed;
width: 80px;
transition: width .5s ease;
}

.transactions .column.feedHidden txfeed {
transition: width .5s ease;
width: 0;
}

.transactions txfeed {
transition: width .5s ease;
}

.transactions txfeed tx {
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
width: 350px;
}

.transactions txsplain {
Expand All @@ -62,18 +113,36 @@

@media (max-width: 600px) {
.transactions .column {
display: table-row;
display: block;
width: 100%;
max-width: 100%;
}

.transactions .column.feedHidden {
width: 100%;
}

.transactions .column1 .toggle {
width: 100%;
}

.transactions .column.feedHidden .toggle {
position: relative;
}
.transactions .column.feedHidden txfeed {
transition: height .5s ease;
width: 100%;
height: 0;
}

.transactions .column txfeed {
width: 100%;
height: 200px;
zoom: .75;
}

.transactions .column txfeed tx {
width: auto;
height: auto;
}

Expand Down Expand Up @@ -104,6 +173,18 @@
}


.dark .transactions .toggle {
background: #000;
}

.dark .transactions .toggle span {
border-color: #222;
}

.dark .transactions .toggle span:hover {
border-color: #333;
background: #222;
}

.dark .transactions .tx-input button {
color: #999;
Expand Down
5 changes: 4 additions & 1 deletion src/app/transactions/transactions.tpl.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="transactions">
<div class="column column1">
<div class="column column1" ng-class="{feedHidden: feedHidden}">
<div class="toggle" ng-click="toggleFeed()">
<span>{{toggleText}}</span>
</div>
<txfeed></txfeed>
</div>
<div class="column column2">
Expand Down

0 comments on commit 0553c3f

Please sign in to comment.