From 180c8273800146c3a123bf821e46b76acc5a14f5 Mon Sep 17 00:00:00 2001 From: Lang Date: Sun, 20 Nov 2016 13:05:45 +0100 Subject: [PATCH] bugfix resign button existence #11 --- .../Resources/public/css/style.mineseeker.css | 4 +++- .../public/js/mine-seeker/user/user-control.js | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Mine/SeekerBundle/Resources/public/css/style.mineseeker.css b/src/Mine/SeekerBundle/Resources/public/css/style.mineseeker.css index e43e690..1729519 100644 --- a/src/Mine/SeekerBundle/Resources/public/css/style.mineseeker.css +++ b/src/Mine/SeekerBundle/Resources/public/css/style.mineseeker.css @@ -505,6 +505,7 @@ main { background: -ms-linear-gradient(top, rgba(70, 73, 66, 1) 0%, rgba(140, 138, 139, 1) 69%, rgba(96, 89, 97, 1) 100%); background: linear-gradient(to bottom, rgba(70, 73, 66, 1) 0%, rgba(140, 138, 139, 1) 69%, rgba(96, 89, 97, 1) 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#464942', endColorstr='#605961', GradientType=0); + display: block; position: relative; width: 95%; height: 50px; @@ -513,11 +514,12 @@ main { font-size: 22px; text-transform: uppercase; text-align: center; - line-height: 45px; + line-height: 40px; border: 3px solid #484742; color: #fff; margin: 10px auto 0 auto; + outline: none; cursor: pointer; -webkit-border-radius: 5px; diff --git a/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/user/user-control.js b/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/user/user-control.js index 4f216c9..64269b0 100644 --- a/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/user/user-control.js +++ b/src/Mine/SeekerBundle/Resources/public/js/mine-seeker/user/user-control.js @@ -24,7 +24,7 @@ class UserControl extends React.Component { } onClickBombSelector(clickedPlayer) { - var activePlayer = this.state.activePlayer ? 'blue' : 'red'; + let activePlayer = this.state.activePlayer ? 'blue' : 'red'; if (this.youCanSelectBomb(activePlayer, clickedPlayer)) { this.state.bombSelected = !this.state.bombSelected; @@ -35,6 +35,11 @@ class UserControl extends React.Component { } } + getResignClass(webPlayer) { + let activePlayer = this.state.activePlayer === 1 ? 'blue' : 'red'; + return "resign" + (webPlayer !== activePlayer ? ' disabled' : ''); + } + activeMines() { return "active-mines" + (this.state.foundMines ? ' found-mine' : ''); } @@ -61,10 +66,10 @@ class UserControl extends React.Component { webPlayer={this.props.webPlayer} active={this.state.activePlayer === 0} onClickBombSelector={this.onClickBombSelector.bind(this, 0)}/> -
+
+ ); }