Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120862

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

Make entityselector always trigger the aftersetentity event

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.

In contrast to If62e8ea (which had the same purpose) this doesn't break setting 
qualifiers
on wikibase-item type claims.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/62/120862/1

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..9de45fe 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 ] );
                },
 
                /**
@@ -706,10 +707,8 @@
                                // label field might be 
undefined/null/false/empty string!
                                var label = entity ? ( entity.label || 
entity.id ) : '';
 
-                               self._setEntity( entity );
                                self.element.val( label );
-
-                               self._trigger( 'aftersetentity', 0, [ entity ? 
entity.id : null ] );
+                               self._setEntity( entity );
                        };
 
                        if ( entity === undefined ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61c0f4aee14fe9c791006bd13c82f82ebe5f4f96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to