Hoo man has uploaded a new change for review.

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

Change subject: Fix triggering of 'restrictEntityPageActions' and 
'blockEntityPageActions'
......................................................................

Fix triggering of 'restrictEntityPageActions' and 'blockEntityPageActions'

Don't trigger this before we have the item and the toolbars
actually in place.

Bug: 68322
Change-Id: I840dda703784e31270952f4d39fb4b486cd892d2
---
M repo/resources/wikibase.ui.entityViewInit.js
1 file changed, 16 insertions(+), 16 deletions(-)


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

diff --git a/repo/resources/wikibase.ui.entityViewInit.js 
b/repo/resources/wikibase.ui.entityViewInit.js
index 69b7a18..50e3051 100644
--- a/repo/resources/wikibase.ui.entityViewInit.js
+++ b/repo/resources/wikibase.ui.entityViewInit.js
@@ -131,22 +131,6 @@
                        } );
                } );
 
-               if ( mw.config.get( 'wbUserIsBlocked' ) ) {
-                       $( wb ).triggerHandler( 'blockEntityPageActions' );
-               } else if ( !mw.config.get( 'wbUserCanEdit' ) ) {
-                       $( wb ).triggerHandler( 'restrictEntityPageActions' );
-               }
-
-               if( !mw.config.get( 'wbIsEditView' ) ) {
-                       // no need to implement a 'disableEntityPageActions' 
since hiding all the toolbars directly like this is
-                       // not really worse than hacking the Toolbar prototype 
to achieve this:
-                       $( '.wikibase-toolbar' ).hide();
-                       $( 'body' ).addClass( 'wb-editing-disabled' );
-                       // make it even harder to edit stuff, e.g. if someone 
is trying to be smart, using
-                       // firebug to show hidden nodes again to click on them:
-                       $( wb ).triggerHandler( 'restrictEntityPageActions' );
-               }
-
                $( wb ).on( 'startItemPageEditMode', function( event, origin, 
options ) {
                        // add copyright warning to 'save' button if there is 
one:
                        if( mw.config.exists( 'wbCopyright' ) ) {
@@ -346,6 +330,22 @@
                } );
 
                wb.ui.initTermBox( entity, repoApi );
+
+               if ( mw.config.get( 'wbUserIsBlocked' ) ) {
+                       $( wb ).triggerHandler( 'blockEntityPageActions' );
+               } else if ( !mw.config.get( 'wbUserCanEdit' ) ) {
+                       $( wb ).triggerHandler( 'restrictEntityPageActions' );
+               }
+
+               if( !mw.config.get( 'wbIsEditView' ) ) {
+                       // no need to implement a 'disableEntityPageActions' 
since hiding all the toolbars directly like this is
+                       // not really worse than hacking the Toolbar prototype 
to achieve this:
+                       $( '.wikibase-toolbar' ).hide();
+                       $( 'body' ).addClass( 'wb-editing-disabled' );
+                       // make it even harder to edit stuff, e.g. if someone 
is trying to be smart, using
+                       // firebug to show hidden nodes again to click on them:
+                       $( wb ).triggerHandler( 'restrictEntityPageActions' );
+               }
        }
 
 } )(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I840dda703784e31270952f4d39fb4b486cd892d2
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