]> git.sesse.net Git - remoteglot/blobdiff - www/js/remoteglot.js
Do not show the board before we have an initial load.
[remoteglot] / www / js / remoteglot.js
index dc0e6307cce2f1e61f341f105e215bf73eb84b9a..d102ad027e351c10c417ce237615eebaa1a7ac4e 100644 (file)
@@ -302,6 +302,7 @@ var request_update = function() {
                        current_analysis_request_timer = setTimeout(function() { request_update(); }, timeout);
                }
        }).fail(function(jqXHR, textStatus, errorThrown) {
+               document.body.style.opacity = null;
                if (textStatus === "abort") {
                        // Aborted because we are switching backends. Abandon and don't retry,
                        // because another one is already started for us.
@@ -1028,6 +1029,8 @@ var patch_move = function(move) {
 /** Update all the HTML on the page, based on current global state.
  */
 var update_board = function() {
+       document.body.style.opacity = null;
+
        var data = displayed_analysis_data || current_analysis_data;
        var current_data = current_analysis_data;  // Convenience alias.
 
@@ -1751,10 +1754,12 @@ var update_imbalance = function(fen) {
        var black_imbalance = '';
        for (var piece in imbalance) {
                for (var i = 0; i < imbalance[piece]; ++i) {
-                       white_imbalance += '<img src="' + svg_pieces['w' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;">';
+                       white_imbalance += '<img src="' + svg_pieces['w' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;" class="imbalance-piece">';
+                       white_imbalance += '<img src="' + svg_pieces['b' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;" class="imbalance-inverted-piece">';
                }
                for (var i = 0; i < -imbalance[piece]; ++i) {
-                       black_imbalance += '<img src="' + svg_pieces['b' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;">';
+                       black_imbalance += '<img src="' + svg_pieces['b' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;" class="imbalance-piece">';
+                       black_imbalance += '<img src="' + svg_pieces['w' + piece.toUpperCase()] + '" alt="" style="width: 15px;height: 15px;" class="imbalance-inverted-piece">';
                }
        }
        $('#whiteimbalance').html(white_imbalance);