Skip to content

Commit

Permalink
views: blur show-hide-button on click
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlucas committed Mar 29, 2016
1 parent 7d35b83 commit c584425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/views/components/show-hide-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ inherits(ShowHideButton, Base)

ShowHideButton.prototype.onClick = function onClick(e, hide) {
e.preventDefault()
e.target.blur()
const settings = this.target.settings
settings.set('userbar.hidden', hide)
this.target.needsLayout()
Expand Down
7 changes: 6 additions & 1 deletion test/views/components/show-hide-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const IRC = require('eyearesee-client')
const Settings = IRC.Settings

test('ShowHideButton', (t) => {
t.plan(22)
t.plan(24)
const verify = common.VerifyNode(t)

const app = {
Expand Down Expand Up @@ -44,6 +44,11 @@ test('ShowHideButton', (t) => {
preventDefault: () => {
t.pass('called preventDefault()')
}
, target: {
blur: () => {
t.pass('called blur')
}
}
}

res.properties.onclick(obj)
Expand Down

0 comments on commit c584425

Please sign in to comment.