Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/67209
Change subject: Search results hook fixes
......................................................................
Search results hook fixes
Make watch star reappear in search results (regression)
Hijack links in watch star so they lazy load (alpha)
Change-Id: I89c08ab828d53f951b9cd54d40322f2c1772f1d8
---
M includes/Resources.php
M javascripts/common/history-alpha.js
M javascripts/modules/mf-watchstar.js
M templates/overlays/search/results.html
4 files changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/09/67209/1
diff --git a/includes/Resources.php b/includes/Resources.php
index 61fce7a..39028b9 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -420,10 +420,10 @@
'javascripts/modules/mf-toggle.js',
'javascripts/modules/mf-cleanuptemplates.js',
'javascripts/modules/mf-last-modified.js',
- 'javascripts/modules/mf-watchstar.js',
'javascripts/modules/mf-photo.js',
'javascripts/modules/mainmenutweaks.js',
'javascripts/modules/search-2.js',
+ 'javascripts/modules/mf-watchstar.js',
'javascripts/modules/mf-references.js'
),
'messages' => array(
diff --git a/javascripts/common/history-alpha.js
b/javascripts/common/history-alpha.js
index 47bdc86..db8925e 100644
--- a/javascripts/common/history-alpha.js
+++ b/javascripts/common/history-alpha.js
@@ -93,6 +93,7 @@
};
// Bind events
+ searchOverlay.on( 'write-results', hijackLinksOverlay );
M.on( 'section-rendered', function( $container ) {
M.history.hijackLinks( $container,
useFuzzyLinkHijacking );
} ).on( 'page-loaded', function( page ) {
diff --git a/javascripts/modules/mf-watchstar.js
b/javascripts/modules/mf-watchstar.js
index bb5c1e0..aa98d5f 100644
--- a/javascripts/modules/mf-watchstar.js
+++ b/javascripts/modules/mf-watchstar.js
@@ -2,6 +2,7 @@
var api = M.require( 'api' ), w = ( function() {
var popup = M.require( 'notifications' ),
+ searchOverlay = M.require( 'search' ).overlay,
CtaDrawer = M.require( 'CtaDrawer' ),
drawer = new CtaDrawer( {
content: mw.msg( 'mobile-frontend-watchlist-cta' ),
@@ -219,8 +220,8 @@
}
function upgradeUI() {
- M.on( 'search-results', function( $ul ) {
- initWatchListIconList( $ul );
+ searchOverlay.on( 'write-results', function( overlay ) {
+ initWatchListIconList( overlay.$( 'ul' ) );
} );
}
diff --git a/templates/overlays/search/results.html
b/templates/overlays/search/results.html
index 71e241f..cb426b4 100644
--- a/templates/overlays/search/results.html
+++ b/templates/overlays/search/results.html
@@ -1,6 +1,6 @@
<li class="no-results">{{noresults}}</li>
{{#results}}
- <li>
- <a href="{{url}}" title="{{title}}">{{{label}}}</a>
+ <li title="{{title}}">
+ <a href="{{url}}" data-title="{{title}}">{{{label}}}</a>
</li>
{{/results}}
--
To view, visit https://gerrit.wikimedia.org/r/67209
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I89c08ab828d53f951b9cd54d40322f2c1772f1d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits