MaxSem has uploaded a new change for review.
https://gerrit.wikimedia.org/r/160784
Change subject: Pre-fill search bar in SearchOverlay with previous contents
......................................................................
Pre-fill search bar in SearchOverlay with previous contents
Bug: 70890
Change-Id: Ic99b06be097ef990b1cad1cc473e73aa9379dbdb
---
M javascripts/modules/search/SearchOverlay.js
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/84/160784/1
diff --git a/javascripts/modules/search/SearchOverlay.js
b/javascripts/modules/search/SearchOverlay.js
index 99633b5..51f6126 100644
--- a/javascripts/modules/search/SearchOverlay.js
+++ b/javascripts/modules/search/SearchOverlay.js
@@ -37,7 +37,8 @@
var
self = this,
$clear = this.$( '.clear' ),
- $form = this.$( 'form' );
+ $form = this.$( 'form' ),
+ searchContents = $( '#searchInput' ).val();
// Make sure search overlay lines up with search header
when the overlay is
// rendered. This is necessary to prevent bug 67140
while sitenotices are
@@ -56,6 +57,11 @@
$clear.toggle( self.$input.val() !== '' );
} );
+ // Set default search bar contents
+ if ( searchContents != this.defaults.placeholderMsg ) {
+ this.$input.val( searchContents );
+ }
+
// initialize the button that clears the search field
$clear.hide().on( M.tapEvent( 'click' ), function() {
self.$input.val( '' ).focus();
--
To view, visit https://gerrit.wikimedia.org/r/160784
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic99b06be097ef990b1cad1cc473e73aa9379dbdb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits