Henning Snater has uploaded a new change for review.
https://gerrit.wikimedia.org/r/53571
Change subject: Re-enabling "add source" link after saving claim
......................................................................
Re-enabling "add source" link after saving claim
Change-Id: I8f2557f55003146f064fcc5f320316f44f25c93d
---
M lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
M repo/tests/selenium/statements/statements_spec.rb
2 files changed, 10 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/71/53571/1
diff --git a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
index a309353..a3b4610 100644
--- a/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
+++ b/lib/resources/jquery.wikibase/jquery.wikibase.entityview.js
@@ -78,11 +78,11 @@
// there could be other ways for entering
edit mode than using the toolbar!
// Whether action shall influence sub-toolbars
of origin:
- var strict = ( options )
- ? ( options.strict ) ? options.strict :
false
+ var exclusive = ( options )
+ ? ( options.exclusive ) ?
options.exclusive : false
: false;
- var originToolbars = ( origin && !strict )
+ var originToolbars = ( origin && !exclusive )
? $( origin ).find( '.wb-ui-toolbar' )
: null;
@@ -94,7 +94,10 @@
// or if the toolbar is a sub-element
of the origin.
if (
$toolbar.children(
'.wb-ui-toolbar-editgroup-ineditmode' ).length === 0
- && ( !originToolbars ||
$.inArray( this, originToolbars ) === -1 )
+ && (
+ !exclusive ||
!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.
@@ -116,7 +119,7 @@
// TODO: this should rather listen to 'valueviewstartediting'
once implemented!
$( this.element )
.on( 'statementviewafterstartediting', function( event ) {
- $( wb ).trigger( 'startItemPageEditMode', [
event.target, { strict: true } ] );
+ $( wb ).trigger( 'startItemPageEditMode', [
event.target, { exclusive: true } ] );
} )
.on( 'referenceviewafterstartediting', function( event ) {
$( wb ).trigger(
diff --git a/repo/tests/selenium/statements/statements_spec.rb
b/repo/tests/selenium/statements/statements_spec.rb
index a5b076d..8806b08 100644
--- a/repo/tests/selenium/statements/statements_spec.rb
+++ b/repo/tests/selenium/statements/statements_spec.rb
@@ -104,7 +104,7 @@
page.snaktypeSelectorIcon?.should be_false
end
end
- it "should check entity suggestor behavior" do
+ it "should check entity suggester behavior" do
on_page(ItemPage) do |page|
page.navigate_to items[0]["url"]
page.wait_for_entity_to_load
@@ -366,6 +366,7 @@
page.saveStatement
ajax_wait
page.wait_for_statement_request_finished
+ page.addReferenceToFirstClaim?.should be_true
page.statement1Name?.should be_true
page.statement1ClaimValue1?.should be_true
page.addStatement?.should be_true
--
To view, visit https://gerrit.wikimedia.org/r/53571
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f2557f55003146f064fcc5f320316f44f25c93d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits