X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Frules.js;h=c3107a675a11e9716d2fa30b915185e236784786;hb=4ecf423bce243e8e10b5b777a95f67ecc9f8d8d3;hp=718021d0bec32e305eaea2beeac6e5d694c8e137;hpb=cf1303697774a12ef9bb154014a38797716944cf;p=vchess.git diff --git a/public/javascripts/components/rules.js b/public/javascripts/components/rules.js index 718021d0..c3107a67 100644 --- a/public/javascripts/components/rules.js +++ b/public/javascripts/components/rules.js @@ -1,3 +1,4 @@ +// Load rules on variant page Vue.component('my-rules', { data: function() { return { content: "" }; @@ -16,11 +17,11 @@ Vue.component('my-rules', { }; xhr.open("GET", "/rules/" + variant, true); xhr.setRequestHeader('X-Requested-With', "XMLHttpRequest"); - xhr.send(null); //TODO: or just xhr.send() ? + xhr.send(); }, methods: { drawDiag: function(fen) { - let [sizeX,sizeY] = VariantRules.size; + let [sizeX,sizeY] = [V.size.x,V.size.y]; let fenParts = fen.split(" "); // Obtain array of pieces images names let board = VariantRules.GetBoard(fenParts[0]); @@ -51,16 +52,15 @@ Vue.component('my-rules', { boardDiv += "
"; for (let j=startY; j>=0 && j"; - if (markArray.length>0 && markArray[i][j]) - boardDiv += ""; if (board[i][j] != VariantRules.EMPTY) { boardDiv += ""; } + if (markArray.length>0 && markArray[i][j]) + boardDiv += ""; boardDiv += "
"; } boardDiv += "";