Commit 9b551f45 authored by ninabreznik's avatar ninabreznik Committed by yann300

Fix selected tab background color

parent fb3dda11
...@@ -21,6 +21,7 @@ var css = csjs` ...@@ -21,6 +21,7 @@ var css = csjs`
.folder, .folder,
.file { .file {
font-size : 14px; font-size : 14px;
cursor : pointer;
} }
.hasFocus { .hasFocus {
background-color : ${styles.colors.backgroundBlue}; background-color : ${styles.colors.backgroundBlue};
......
...@@ -51,7 +51,6 @@ var css = csjs` ...@@ -51,7 +51,6 @@ var css = csjs`
min-width: 60px; min-width: 60px;
font-size: 0.9em; font-size: 0.9em;
cursor: pointer; cursor: pointer;
background-color: ${styles.colors.transparent};
font-size: 1em; font-size: 1em;
text-align: center; text-align: center;
} }
...@@ -61,12 +60,6 @@ var css = csjs` ...@@ -61,12 +60,6 @@ var css = csjs`
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.opts_li:active {
background-color: ${styles.colors.backgroundBlue};
}
.opts_li a {
color: inherit;
}
.opts_li { .opts_li {
display: block; display: block;
} }
......
var $ = require('jquery') var $ = require('jquery')
// -------------- styling ----------------------
var csjs = require('csjs-inject')
var remix = require('ethereum-remix')
var styleGuide = remix.ui.styleGuide
var styles = styleGuide()
module.exports = tabbedMenu module.exports = tabbedMenu
var css = csjs`
.active {
background-color: ${styles.colors.backgroundBlue};
}
`
function tabbedMenu (container, appAPI, events, opts) { function tabbedMenu (container, appAPI, events, opts) {
var lis = container.querySelectorAll('li') var lis = container.querySelectorAll('li')
for (var li = 0; li < lis.length; ++li) { for (var li = 0; li < lis.length; ++li) {
...@@ -20,15 +32,17 @@ function tabbedMenu (container, appAPI, events, opts) { ...@@ -20,15 +32,17 @@ function tabbedMenu (container, appAPI, events, opts) {
selectTab(container.querySelector('.compileView')) selectTab(container.querySelector('.compileView'))
// select tab // select tab
function selectTab (el) { function selectTab (el) {
el = $(el) var match = /[a-z]+View/.exec(el.className)
var match = /[a-z]+View/.exec(el.get(0).className)
if (!match) return if (!match) return
var cls = match[0] var cls = match[0]
if (!el.hasClass('active')) { if (!el.classList.contains(css.active)) {
el.parent().find('li').removeClass('active') el.parentNode.querySelectorAll('li').forEach(function (x) {
x.classList.remove(css.active)
})
$('#optionViews').attr('class', '').addClass(cls) $('#optionViews').attr('class', '').addClass(cls)
el.addClass('active') el.classList.add(css.active)
} }
events.app.trigger('tabChanged', [cls]) events.app.trigger('tabChanged', [cls])
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment