Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399430 )

Change subject: Hide Ctrl+Space help toast when shortcut is used
......................................................................

Hide Ctrl+Space help toast when shortcut is used

When the user has used the Ctrl+Space keyboard shortcut, it’s
probably safe to assume that they no longer need the hint informing them
of the Ctrl+Space keyboard shortcut, so let’s hide it instead of making
them hurry to click the “🗙” button before the toast vanishes.

Change-Id: I638fa3c423ca7076e898b920f9bbc0f8bb76d730
---
M wikibase/queryService/ui/editor/Editor.js
1 file changed, 6 insertions(+), 3 deletions(-)


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

diff --git a/wikibase/queryService/ui/editor/Editor.js 
b/wikibase/queryService/ui/editor/Editor.js
index 0292140..7416404 100644
--- a/wikibase/queryService/ui/editor/Editor.js
+++ b/wikibase/queryService/ui/editor/Editor.js
@@ -3,7 +3,7 @@
 wikibase.queryService.ui = wikibase.queryService.ui || {};
 wikibase.queryService.ui.editor = wikibase.queryService.ui.editor || {};
 
-wikibase.queryService.ui.editor.Editor = ( function( $, wikibase, CodeMirror ) 
{
+wikibase.queryService.ui.editor.Editor = ( function( $, wikibase, CodeMirror, 
Cookies ) {
        'use strict';
 
        var CODEMIRROR_DEFAULTS = {
@@ -11,7 +11,10 @@
                        'matchBrackets': true,
                        'mode': 'sparql',
                        'extraKeys': {
-                               'Ctrl-Space': 'autocomplete',
+                               'Ctrl-Space': function( cm ) {
+                                       Cookies.set( 
'hide-toast-wdqs-app-footer-help', true );
+                                       cm.execCommand( 'autocomplete' );
+                               },
                                'Tab': function( cm ) {
                                        var spaces = Array( cm.getOption( 
'indentUnit' ) + 1 ).join( ' ' );
                                        cm.replaceSelection( spaces );
@@ -313,4 +316,4 @@
 
        return SELF;
 
-}( jQuery, wikibase, CodeMirror ) );
+}( jQuery, wikibase, CodeMirror, Cookies ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I638fa3c423ca7076e898b920f9bbc0f8bb76d730
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to