Mercurial > xmpp-account-manager
diff nickname.js @ 7:13e8e4ea53c0
Change nickname on blur, remove the button.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 22 Dec 2018 16:07:26 +0100 |
parents | d6df73b466f6 |
children | e47b9bd55192 |
line wrap: on
line diff
--- a/nickname.js +++ b/nickname.js @@ -2,7 +2,6 @@ function initNickname(connection) { const nick_input = document.getElementById('nick'); - const nick_change = document.getElementById('nick-change'); const iq = $iq({type: 'get'}) .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub'}) @@ -24,7 +23,7 @@ function initNickname(connection) { console.log('Failed to retrieve nickname: ' + string); } - nick_change.addEventListener('click', function (evt) { + nick_input.addEventListener('blur', function (evt) { const iq = $iq({type: 'set'}) .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub'}) .c('publish', {node: 'http://jabber.org/protocol/nick'})