jenkins-bot has submitted this change and it was merged.
Change subject: Do search on pressing enter key
......................................................................
Do search on pressing enter key
Change-Id: I3101738d0800d77caf6b8253361117af0b550a4a
---
M MainPage/resources/js/ext.translate.mainpage.js
1 file changed, 9 insertions(+), 3 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MainPage/resources/js/ext.translate.mainpage.js
b/MainPage/resources/js/ext.translate.mainpage.js
index d71466c..a7f08a5 100644
--- a/MainPage/resources/js/ext.translate.mainpage.js
+++ b/MainPage/resources/js/ext.translate.mainpage.js
@@ -1,10 +1,16 @@
( function ( $, mw ) {
'use strict';
+ function search () {
+ window.location.href = new mw.Uri( mw.util.wikiGetlink(
'Special:SearchTranslations' ) )
+ .extend( { query: $( 'input.searchbox' ).val() } );
+ }
$( document ).ready( function () {
- $( '.twn-mainpage-search button' ).on( 'click', function () {
- window.location.href = new mw.Uri( mw.util.wikiGetlink(
'Special:SearchTranslations' ) )
- .extend( { query: $( 'input.searchbox' ).val()
} );
+ $( '.twn-mainpage-search button' ).on( 'click', search );
+ $( '.twn-mainpage-search input' ).on( 'keyup', function( e ) {
+ if ( e.which === 13 ) { // Enter key
+ search();
+ }
} );
} );
}( jQuery, mediaWiki ) );
--
To view, visit https://gerrit.wikimedia.org/r/57066
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3101738d0800d77caf6b8253361117af0b550a4a
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits