Skip to content

Commit

Permalink
stop history animations if clicked again
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Mar 27, 2017
1 parent 474b60e commit 7be61f6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion busters_css.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"public/css/singlecsshash":"9cbb843ee5b19e655abe03a5498edac4"}
{"public/css/singlecsshash":"5984633f27fbf732a2c64002f4d30aa9"}
2 changes: 1 addition & 1 deletion busters_js.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"public/js/singlejshash":"f392bdb8ee6300c53a037b29c0d09f92"}
{"public/js/singlejshash":"2c5f5cfcf14f0538387103d5d306e6fb"}
5 changes: 4 additions & 1 deletion public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,10 @@ strong {
position: relative;
left: -26px;
bottom: 13px;
font-size: 18px; }
font-size: 18px;
background: #222832;
z-index: 9;
width: 66px; }

.tooltip {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion public/css/main.min.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion public/js/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function build_block(id) { //build and append the block html

function move_on_down() { //move the blocks left
if (uiBlocksCount > 10) {
$('.block:first').animate({ opacity: 0 }, 800, function () { $('.block:first').remove(); });
$('.block:first').animate({ opacity: 0 }, 800, function () {
$('.block:first').remove();
});
$('.block').animate({ left: '-=' + block_left_px }, 800, function () { });
uiBlocksCount--;

Expand Down
5 changes: 3 additions & 2 deletions public/js/ui_events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global $, window, document */
/* global randStr, toTitleCase, connect_to_server, refreshHomePanel, closeNoticePanel, openNoticePanel, show_tx_step, marbles*/
/* global fixCss */
/* global fixCss, pendingTxDrawing:true */
/* exported record_company, autoCloseNoticePanel, start_up, block_ui_delay*/
var ws = {};
var bgcolors = ['whitebg', 'blackbg', 'redbg', 'greenbg', 'bluebg', 'purplebg', 'pinkbg', 'orangebg', 'yellowbg'];
Expand Down Expand Up @@ -230,7 +230,8 @@ $(document).on('ready', function () {
$('.auditingMarble').removeClass('auditingMarble');

if(!auditingMarble || marbles[marble_id].name != auditingMarble.name) {//different marble than before!
$('.txHistoryWrap').html('');//clear
for(var x in pendingTxDrawing) clearTimeout(pendingTxDrawing[x]);
$('.txHistoryWrap').html(''); //clear
fixCss();
}

Expand Down
9 changes: 6 additions & 3 deletions public/js/websocket.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* global new_block, $, document, WebSocket, escapeHtml, ws:true, start_up:true, known_companies:true, autoCloseNoticePanel:true */
/* global show_start_up_step, build_notification, build_user_panels, build_company_panel, populate_users_marbles, show_tx_step*/
/* global getRandomInt, block_ui_delay:true, build_a_tx, auditingMarble*/
/* exported transfer_marble, record_company, connect_to_server, refreshHomePanel, fixCss*/
/* exported transfer_marble, record_company, connect_to_server, refreshHomePanel, fixCss, pendingTxDrawing*/

var getEverythingWatchdog = null;
var wsTxt = '[ws]';
var pendingTransaction = null;
var pendingTxDrawing = [];

// =================================================================================
// Socket Stuff
Expand Down Expand Up @@ -142,6 +143,8 @@ function connect_to_server() {
var x = 0;
var count = $('.txDetails').length;

for(x in pendingTxDrawing) clearTimeout(pendingTxDrawing[x]);

if (count <= 0) { //if no tx shown yet, append to back
$('.txHistoryWrap').html(''); //clear
fixCss();
Expand Down Expand Up @@ -288,14 +291,14 @@ function clear_trash() {

// delay build each transaction
function slowBuildtx(data, txNumber, built){
setTimeout(function () {
pendingTxDrawing.push(setTimeout(function () {
var html = build_a_tx(data, txNumber);
$('.txHistoryWrap').append(html);
$('.txDetails:last').animate({ opacity: 1, left: 0 }, 600, function () {
//after animate
});
fixCss();
}, (built * 300));
}, (built * 300)));
}

function fixCss() {
Expand Down
3 changes: 3 additions & 0 deletions scss/blockchain.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ $block_size: 32px;
left: -26px;
bottom: 13px;
font-size: 18px;
background: $acc_color1;
z-index: 9;
width: 66px;
}

.tooltip {
Expand Down

0 comments on commit 7be61f6

Please sign in to comment.