This commit is contained in:
Henrik Ingo
2018-01-07 18:46:36 +02:00
parent 4b5fe0fbf8
commit e99a2df7f2
2 changed files with 9 additions and 9 deletions

View File

@@ -1599,7 +1599,7 @@
* *
* This plugin does two things: * This plugin does two things:
* *
* Set stopPropagagation on any element that might take text input. This allows users to type, for * Set stopPropagation on any element that might take text input. This allows users to type, for
* example, the letter 'P' into a form field, without causing the presenter console to spring up. * example, the letter 'P' into a form field, without causing the presenter console to spring up.
* *
* On impress:stepleave, de-focus any potentially active * On impress:stepleave, de-focus any potentially active
@@ -1621,20 +1621,20 @@
var root; var root;
var api; var api;
document.addEventListener( "impress:init", function(event) { document.addEventListener( "impress:init", function( event ) {
root = event.target; root = event.target;
api = event.detail.api; api = event.detail.api;
var gc = api.lib.gc; var gc = api.lib.gc;
var selectors = ["input[type=text]", "textarea", "select", "[contenteditable=true]"]; var selectors = [ "input[type=text]", "textarea", "select", "[contenteditable=true]" ];
for ( var selector of selectors ) { for ( var selector of selectors ) {
var elements = document.querySelectorAll(selector); var elements = document.querySelectorAll( selector );
if ( ! elements ) { if ( !elements ) {
continue; continue;
} }
for ( var i = 0; i < elements.length; i++) { for ( var i = 0; i < elements.length; i++ ) {
var e = elements[i]; var e = elements[ i ];
gc.addEventListener( e, "keydown", function( event ) { gc.addEventListener( e, "keydown", function( event ) {
event.stopPropagation(); event.stopPropagation();
} ); } );

View File

@@ -5,7 +5,7 @@
* *
* This plugin does two things: * This plugin does two things:
* *
* Set stopPropagagation on any element that might take text input. This allows users to type, for * Set stopPropagation on any element that might take text input. This allows users to type, for
* example, the letter 'P' into a form field, without causing the presenter console to spring up. * example, the letter 'P' into a form field, without causing the presenter console to spring up.
* *
* On impress:stepleave, de-focus any potentially active * On impress:stepleave, de-focus any potentially active