From f3d1bfe8e6968a25c625545c537bf8f67fffc897 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Sun, 12 Mar 2017 01:01:43 +0300 Subject: [PATCH] =?UTF-8?q?Web=20interface:=20=D0=B5=D1=89=D0=B5=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D1=82=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D1=81=D1=82=D0=B8=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20Nav?= =?UTF-8?q?bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/static/components.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/webinterface/src/main/resources/static/components.js b/webinterface/src/main/resources/static/components.js index 84131aa..c64e198 100644 --- a/webinterface/src/main/resources/static/components.js +++ b/webinterface/src/main/resources/static/components.js @@ -4,9 +4,19 @@ const nbsp = '\u00a0'; // -- Bootstrap -- // var MainMenuItem = React.createClass({ - render: function(){return( - ce('li', null, ce('a', {href: this.props.href}, this.props.title)) - )} + render: function(){ + var liActive = {} + var aText = this.props.title + + if (this.props.active) { + liActive = {className: 'active'}; + aText = [ce('span', {className: 'glyphicon glyphicon-menu-right'}), ' ', this.props.title]; + } + + return( + ce('li', liActive, ce('a', {href: this.props.href}, aText)) + ) + } }); var Navbar = React.createClass({