Daniel Werner has submitted this change and it was merged.

Change subject: Removed direct use of _trigger from edittoolbar widget
......................................................................


Removed direct use of _trigger from edittoolbar widget

Change-Id: I3ed4b8a0511398f2b0a2c98734b0414a7dad095b
---
M lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
M lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
M lib/resources/jquery.wikibase/toolbar/edittoolbar.js
3 files changed, 21 insertions(+), 2 deletions(-)

Approvals:
  Daniel Werner: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
index b0d003d..9dafebc 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimview.js
@@ -479,6 +479,15 @@
        },
 
        /**
+        * Removes any error state from the widget.
+        * @since 0.4
+        */
+       removeErrorState: function() {
+               this.element.removeClass( 'wb-error' );
+               this._trigger( 'toggleerror' );
+       },
+
+       /**
         * Disables the Claim view.
         * @since 0.4
         */
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
index 92d989b..b59180f 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.referenceview.js
@@ -185,6 +185,15 @@
                        self._snakList = self._reference.getSnaks();
                        self._updateReferenceHashClass( savedReference );
                } );
+       },
+
+       /**
+        * Removes any error state from the widget.
+        * @since 0.4
+        */
+       removeErrorState: function() {
+               this.element.removeClass( 'wb-error' );
+               this._trigger( 'toggleerror' );
        }
 
 } );
diff --git a/lib/resources/jquery.wikibase/toolbar/edittoolbar.js 
b/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
index 26a64e2..f56911a 100644
--- a/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
+++ b/lib/resources/jquery.wikibase/toolbar/edittoolbar.js
@@ -55,7 +55,8 @@
                _requiredMethods: [
                        'startEditing',
                        'stopEditing',
-                       'isValid'
+                       'isValid',
+                       'removeErrorState'
                ],
 
                /**
@@ -296,7 +297,7 @@
 
                        anchor.getTooltip().on( 'hide', function( e ) {
                                self.element.removeClass( 'wb-error' 
).addClass( 'wb-edit' );
-                               self._interactionWidget._trigger( 'toggleerror' 
);
+                               self._interactionWidget.removeErrorState();
                        } );
 
                        anchor.getTooltip().on( 'afterhide', function( e ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ed4b8a0511398f2b0a2c98734b0414a7dad095b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de>
Gerrit-Reviewer: Daniel Werner <daniel.wer...@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