remove workarounds

pull/2713/merge
Thibault Duplessis 2017-03-08 09:03:38 +01:00
parent 9a6a432019
commit 5085e6101e
4 changed files with 4 additions and 12 deletions

View File

@ -14,8 +14,6 @@ module.exports = function(ctrl) {
});
}
var global3d = !!document.querySelector('#top.is3d');
function makeConfig(ctrl) {
var opts = ctrl.makeCgOpts();
var config = {
@ -25,7 +23,7 @@ function makeConfig(ctrl) {
lastMove: opts.lastMove,
orientation: ctrl.data.orientation,
coordinates: ctrl.data.pref.coords !== 0,
addPieceZIndex: ctrl.data.pref.is3d || global3d,
addPieceZIndex: ctrl.data.pref.is3d,
viewOnly: !!ctrl.embed,
movable: {
free: false,

View File

@ -74,15 +74,13 @@ function onMouseEvent(ctrl) {
};
}
var global3d = document.getElementById('top').classList.contains('is3d');
function makeConfig(ctrl) {
return {
fen: ctrl.cfg.fen,
orientation: ctrl.options.orientation || 'white',
coordinates: !ctrl.embed,
autoCastle: false,
addPieceZIndex: ctrl.cfg.is3d || global3d,
addPieceZIndex: ctrl.cfg.is3d,
movable: {
free: true,
color: 'both',

View File

@ -9,8 +9,6 @@ module.exports = function(ctrl) {
});
}
var global3d = document.getElementById('top').classList.contains('is3d');
function makeConfig(ctrl) {
var opts = ctrl.makeCgOpts();
return {
@ -20,7 +18,7 @@ function makeConfig(ctrl) {
check: opts.check,
lastMove: opts.lastMove,
coordinates: ctrl.pref.coords !== 0,
addPieceZIndex: ctrl.pref.is3d || global3d,
addPieceZIndex: ctrl.pref.is3d,
movable: {
free: false,
color: opts.movable.color,

View File

@ -4,8 +4,6 @@ var util = require('./util');
var round = require('./round');
var m = require('mithril');
var global3d = !!document.querySelector('#top.is3d');
function makeConfig(ctrl) {
var data = ctrl.data, hooks = ctrl.makeCgHooks();
var step = round.plyStep(data, ctrl.vm.ply);
@ -17,7 +15,7 @@ function makeConfig(ctrl) {
lastMove: util.uci2move(step.uci),
check: !!step.check,
coordinates: data.pref.coords !== 0,
addPieceZIndex: ctrl.data.pref.is3d || global3d,
addPieceZIndex: ctrl.data.pref.is3d,
autoCastle: data.game.variant.key === 'standard',
highlight: {
lastMove: data.pref.highlight,