Henning Snater has submitted this change and it was merged. Change subject: (hotfix) Fixes broken editing introduced in 55e6d866 ......................................................................
(hotfix) Fixes broken editing introduced in 55e6d866 In 55e6d866 some undefined event variable has been used in the claimlistview which has lead to the edit mode not being able to start for claims. For some reason this has still been working in Chrome since the event variable was somehow available in some outer scope apparently. Change-Id: I48e4de5fa6984f870db7acbd49b267cac653cdcb --- M lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js 1 file changed, 10 insertions(+), 5 deletions(-) Approvals: Henning Snater: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js index 341b909..205a4c7 100644 --- a/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js +++ b/lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js @@ -77,7 +77,10 @@ .on( this._lmwEvent( 'startediting' ) + ' ' + this._lmwEvent( 'afterstopediting' ), function( event ) { - self._toggleEditState( event.type === self._lmwEvent( 'startediting' ) ); + self._toggleEditState( + event.type === self._lmwEvent( 'startediting' ), + $( event.target ) + ); } ) .on( this._lmwEvent( 'toggleerror' ), function( e, error ) { @@ -96,11 +99,13 @@ /** * Toggles edit state visually by assigning/removing wb-edit css class. * - * @param {boolean} [on] "false" by default + * @param {boolean} [toggleOn=false] Indicates whether to switch edit state on or off. + * @param {jQuery} [$origin] The list member widget's element responsible for toggling the edit + * state. Needs to be set when assigning edit state. */ - _toggleEditState: function( on ) { - if( on ) { - $( event.target ).parents( '.wb-claim-section' ).addClass( 'wb-edit' ); + _toggleEditState: function( toggleOn, $origin ) { + if( toggleOn ) { + $origin.parents( '.wb-claim-section' ).addClass( 'wb-edit' ); } else { // remove 'wb-edit' from all section nodes if the section itself has not child // nodes with 'wb-edit' still set. This is necessary because of how we remove new -- To view, visit https://gerrit.wikimedia.org/r/60471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48e4de5fa6984f870db7acbd49b267cac653cdcb Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Werner <daniel.wer...@wikimedia.de> Gerrit-Reviewer: Henning Snater <henning.sna...@wikimedia.de> Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits