# HG changeset patch # User Emmanuel Gil Peyrot # Date 1545491246 -3600 # Node ID 13e8e4ea53c0ee3577b7d0b6e71cb9f39d1b4535 # Parent 129f5c565f1b305b1ec73282482040c3f9f2c4ef Change nickname on blur, remove the button. diff --git a/index.xhtml b/index.xhtml --- a/index.xhtml +++ b/index.xhtml @@ -52,8 +52,7 @@

Account

Nickname

-
- +

Avatar

diff --git a/nickname.js b/nickname.js --- 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'})