support for ZH pockets in embedded analysis - closes #5139

pull/5145/head
Thibault Duplessis 2019-05-24 15:37:57 +02:00
parent 845b59b8e4
commit ee49b8705a
4 changed files with 23 additions and 2 deletions

View File

@ -19,5 +19,6 @@
@import '../../../tree/css/tree';
@import '../../../chess/css/opening';
@import '../../../chess/css/control';
@import '../../../chess/css/zh-pocket';
@import '../embed/embed';

View File

@ -9,5 +9,25 @@
grid-template-rows: auto 2.5rem;
grid-template-areas:
'board tools'
'board controls'
'board controls';
}
.pocket {
&-top { grid-area: pocket-top; }
&-bottom { grid-area: pocket-bot; }
width: 100%;
box-shadow: 0 3px 5px rgba(0,0,0,0.3) inset;
background: #888;
border-radius: 0;
}
.analyse.variant-crazyhouse {
grid-template-rows: 60px auto 2.5rem 60px;
body.supports-max-content & {
grid-template-rows: max-content auto 2.5rem max-content;
}
grid-template-areas:
'board pocket-top'
'board tools'
'board controls'
'board pocket-bot';
}

View File

@ -163,6 +163,7 @@ $(function() {
});
lichess.startEmbeddedAnalyse = function(opts) {
document.body.classList.toggle('supports-max-content', !!window.chrome);
opts.socketSend = $.noop
opts.initialPly = 'url';
opts.trans = lichess.trans(opts.i18n);

View File

@ -16,7 +16,6 @@ lichess.isCol1 = (function() {
var isCol1Cache = 'init'; // 'init' | 'rec' | boolean
return function() {
var ctk = 'isCol1' + Math.random();
if (typeof isCol1Cache == 'string') {
if (isCol1Cache == 'init') { // only once
window.addEventListener('resize', function() { isCol1Cache = 'rec' }); // recompute on resize