Jonas Kress (WMDE) has uploaded a new change for review.

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

Change subject: Fix explorer button
......................................................................

Fix explorer button

Change-Id: I84f0d97254140b4d01aae8c7733d9da092fdcdfd
---
M wikibase/queryService/ui/resultBrowser/TableResultBrowser.js
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/27/275827/1

diff --git a/wikibase/queryService/ui/resultBrowser/TableResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/TableResultBrowser.js
index 442d477..9f8787e 100644
--- a/wikibase/queryService/ui/resultBrowser/TableResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/TableResultBrowser.js
@@ -98,7 +98,7 @@
 
                                if ( this.isExploreUrl( href ) ) {
                                        $td.prepend( ' ' );
-                                       $td.prepend( this.createExploreButton() 
);
+                                       $td.prepend( this.createExploreButton( 
href ) );
                                }
 
                                if ( this.isCommonsResource( href ) ) {
@@ -171,8 +171,8 @@
         * @private
         * @returns {jQuery}
         */
-       BootstrapTable.prototype.createExploreButton = function () {
-               return $( '<a href="#" title="Explore item" class="explore 
glyphicon glyphicon-search" aria-hidden="true">' );
+       BootstrapTable.prototype.createExploreButton = function ( url ) {
+               return $( '<a href="' + url + '" title="Explore item" 
class="explore glyphicon glyphicon-search" aria-hidden="true">' );
        };
 
        /**
@@ -254,11 +254,12 @@
         * @private
         */
        BootstrapTable.prototype.handleExploreItem = function ( e ) {
-               var id, url = $( e.target ).prev().attr( 'href' ) || '', match;
+               var id, url = $( e.target ).attr( 'href' ) || '', match;
+               e.preventDefault();
 
                match = url.match( EXPLORE_URL + '(.+)' );
                if ( !match ) {
-                       return;
+                       return false;
                }
 
                var $explorer = $( '.explorer' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84f0d97254140b4d01aae8c7733d9da092fdcdfd
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to