Skip to content

Commit

Permalink
lib: replace ShowHideButton with shortcut
Browse files Browse the repository at this point in the history
We have a hot key for showing and hiding the user bar. It looks weird
and awkward, so remove it.
  • Loading branch information
evanlucas committed Apr 1, 2016
1 parent 217c00a commit 82b9634
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 128 deletions.
6 changes: 1 addition & 5 deletions lib/views/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const Base = require('vdelement')
const Userbar = require('./userbar')
const linker = require('../linker')
const Message = require('./message-log')
const ShowHideButton = require('./components/show-hide-button')

module.exports = Channel

Expand All @@ -18,7 +17,6 @@ function Channel(target) {

this.ub = new Userbar(this.target)
this.message = new Message(this.target)
this.showHide = new ShowHideButton(this.target)
}
inherits(Channel, Base)

Expand All @@ -42,7 +40,6 @@ Channel.prototype.render = function render(channel) {
: ''

const hideUserbar = this.target.settings.get('userbar.hidden')
const showHide = this.showHide.render(hideUserbar)

const ubcl = hideUserbar
? 'userbar-hidden'
Expand All @@ -55,8 +52,7 @@ Channel.prototype.render = function render(channel) {
return [
h('irc-header.pure-g', [
h('.pure-u-1-1', [
showHide
, h('h2.title', channel.name)
h('h2.title', channel.name)
, h('p.subtitle', topic)
])
])
Expand Down
39 changes: 0 additions & 39 deletions lib/views/components/show-hide-button.js

This file was deleted.

7 changes: 2 additions & 5 deletions test/views/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ test('ChannelView', (t) => {
})

const hhkids = headerKid.children
t.equal(hhkids.length, 3, 'header.children[0].children has 2 objects')
t.equal(hhkids.length, 2, 'header.children[0].children has 2 objects')

const btn = hhkids[0]
t.equal(btn.tagName, 'BUTTON')


const title = hhkids[1]
const title = hhkids[0]
t.equal(title.tagName, 'H2')
t.deepEqual(title.properties, {
className: 'title'
Expand Down
79 changes: 0 additions & 79 deletions test/views/components/show-hide-button.js

This file was deleted.

0 comments on commit 82b9634

Please sign in to comment.