jenkins-bot has submitted this change and it was merged.

Change subject: Make entityselector always trigger aftersetentity event
......................................................................


Make entityselector always trigger aftersetentity event

Without this, sometimes the entityselector happily selects something, but the
expert is not informed and just saves a different value while showing you the
right one in the input box.

This change also makes the EntityIdInput not listen on entityselectorselect, 
which
is a quite useless event because it happens before the entity actually is set.

Bug: 62868
Change-Id: If62e8ea3fca1feb148532d1907e815e63cee771d
---
M lib/resources/experts/EntityIdInput.js
M lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
2 files changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  WikidataJenkins: Verified
  jenkins-bot: Verified



diff --git a/lib/resources/experts/EntityIdInput.js 
b/lib/resources/experts/EntityIdInput.js
index 187f52e..8995dbc 100644
--- a/lib/resources/experts/EntityIdInput.js
+++ b/lib/resources/experts/EntityIdInput.js
@@ -63,7 +63,7 @@
                                }
                        )
                        .on(
-                               'eachchange entityselectorselect 
entityselectoraftersetentity',
+                               'eachchange entityselectoraftersetentity',
                                function( e ) {
                                        // Entity selector's value is actual 
value after change.
                                        self._actualValue = false;
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
index c843948..1248d9e 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityselector.js
@@ -683,6 +683,7 @@
                                        url: entity.url
                                };
                        }
+                       this._trigger( 'aftersetentity', 0, [ entity ? 
entity.id : null ] );
                },
 
                /**
@@ -708,8 +709,6 @@
 
                                self._setEntity( entity );
                                self.element.val( label );
-
-                               self._trigger( 'aftersetentity', 0, [ entity ? 
entity.id : null ] );
                        };
 
                        if ( entity === undefined ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/119988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If62e8ea3fca1feb148532d1907e815e63cee771d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <adrian.l...@wikimedia.de>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: WikidataJenkins <wikidata-servi...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to