Tobias Gritschacher has submitted this change and it was merged.

Change subject: Correctly dis-/enabling reference toolbars
......................................................................


Correctly dis-/enabling reference toolbars

Change-Id: I12f0a1be4e3a65bba2bb10c1becdba3218b06f27
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
1 file changed, 7 insertions(+), 9 deletions(-)

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



diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js 
b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
index a3b4610..b9d0a58 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
@@ -78,11 +78,12 @@
                                //       there could be other ways for entering 
edit mode than using the toolbar!
 
                                // Whether action shall influence sub-toolbars 
of origin:
-                               var exclusive = ( options )
-                                       ? ( options.exclusive ) ? 
options.exclusive : false
-                                       : false;
+                               var exclusive;
+                               if ( options && typeof options.exclusive === 
'boolean' ) {
+                                       exclusive = options.exclusive;
+                               }
 
-                               var originToolbars = ( origin && !exclusive )
+                               var originToolbars = ( origin && exclusive === 
false )
                                        ? $( origin ).find( '.wb-ui-toolbar' )
                                        : null;
 
@@ -94,10 +95,7 @@
                                        // or if the toolbar is a sub-element 
of the origin.
                                        if (
                                                $toolbar.children( 
'.wb-ui-toolbar-editgroup-ineditmode' ).length === 0
-                                               && (
-                                                       !exclusive || 
!originToolbars
-                                                       || $.inArray( this, 
originToolbars ) === -1
-                                               )
+                                               && ( !originToolbars || 
$.inArray( this, originToolbars ) === -1 )
                                                // Checking if toolbar is 
defined is done for the purpose of debugging only;
                                                // Toolbar may only be 
undefined under some weird circumstances, e.g. when
                                                // doing $( 'body' ).empty() 
for debugging.
@@ -124,7 +122,7 @@
                .on( 'referenceviewafterstartediting', function( event ) {
                        $( wb ).trigger(
                                'startItemPageEditMode',
-                               [ event.target, { wbCopyrightWarningGravity: 
'sw' } ]
+                               [ event.target, { exclusive: false, 
wbCopyrightWarningGravity: 'sw' } ]
                        );
                } )
                .on( 'snakviewstopediting', function( event, dropValue ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I12f0a1be4e3a65bba2bb10c1becdba3218b06f27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to