# HG changeset patch # User Emmanuel Gil Peyrot # Date 1545593462 -3600 # Node ID 45bd945c57227b804bab19aa33177bc2d64ca9bc # Parent 038cab68fa3a26fbecc0b4386a70f90847c011ca Change all blur events to change, prevents a stanza when no change occured. diff --git a/mam.js b/mam.js --- a/mam.js +++ b/mam.js @@ -74,8 +74,8 @@ function initMAM(connection) { } prefs_default.addEventListener('change', submitPrefs); - prefs_always.addEventListener('blur', submitPrefs); - prefs_never.addEventListener('blur', submitPrefs); + prefs_always.addEventListener('change', submitPrefs); + prefs_never.addEventListener('change', submitPrefs); function onPrefsSet(iq) { diff --git a/nickname.js b/nickname.js --- a/nickname.js +++ b/nickname.js @@ -27,7 +27,7 @@ function initNickname(connection) { hideSpinner(spinner_img); } - nick_input.addEventListener('blur', function (evt) { + nick_input.addEventListener('change', function (evt) { const iq = $iq({type: 'set'}) .c('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub'}) .c('publish', {node: 'http://jabber.org/protocol/nick'}) diff --git a/roster.js b/roster.js --- a/roster.js +++ b/roster.js @@ -28,14 +28,14 @@ function initRoster(connection) { td = document.createElementNS('http://www.w3.org/1999/xhtml', 'td'); const input = document.createElementNS('http://www.w3.org/1999/xhtml', 'input'); input.value = name; - input.onblur = function (evt) { + input.addEventListener('change', function (evt) { const iq = $iq({type: 'set'}) .c('query', {xmlns: NS.roster}) .c('item', {jid: jid, name: evt.target.value}); for (let group of groups) iq.c('group').t(group.textContent).up(); connection.sendIQ(iq, onRosterSet, onRosterSetError.bind(null, 'Roster set failed.')); - }; + }); td.appendChild(input); tr.appendChild(td); td = document.createElementNS('http://www.w3.org/1999/xhtml', 'td'); diff --git a/vcard.js b/vcard.js --- a/vcard.js +++ b/vcard.js @@ -69,8 +69,8 @@ function initVCard(connection) { displaySpinner(spinner_img); } - vcard_fn.addEventListener('blur', setVCard4); - vcard_email.addEventListener('blur', setVCard4); + vcard_fn.addEventListener('change', setVCard4); + vcard_email.addEventListener('change', setVCard4); vcard_bday.addEventListener('change', setVCard4); function onVCard4Changed(result_iq)