Replace keyup listener with input listener (#3567)
Fixes #1270. Credit to @viamage
This commit is contained in:
parent
25453b8f9d
commit
667b82e6ce
|
|
@ -1084,7 +1084,7 @@ this.searchCookieName=this.options.treeName+'search'
|
|||
this.$searchInput=$(this.options.searchInput)
|
||||
this.$el.on('click','li > div.group',function(){self.toggleGroup($(this).closest('li'))
|
||||
return false})
|
||||
this.$searchInput.on('keyup',function(){self.handleSearchChange()})
|
||||
this.$searchInput.on('input',function(){self.handleSearchChange()})
|
||||
var searchTerm=$.cookie(this.searchCookieName)
|
||||
if(searchTerm!==undefined&&searchTerm.length>0){this.$searchInput.val(searchTerm)
|
||||
this.applySearch()}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
return false
|
||||
})
|
||||
|
||||
this.$searchInput.on('keyup', function(){
|
||||
this.$searchInput.on('input', function(){
|
||||
self.handleSearchChange()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ if(get&&editor.popups.isVisible('link.insert')){update();}});}
|
|||
return $popup;}
|
||||
function remove(){var link=get();var $current_image=editor.image?editor.image.get():null;if(editor.events.trigger('link.beforeRemove',[link])===false)return false;if($current_image&&link){$current_image.unwrap();editor.image.edit($current_image);}
|
||||
else if(link){editor.selection.save();$(link).replaceWith($(link).html());editor.selection.restore();_hideEditPopup();}}
|
||||
function _init(){editor.events.on('keyup',function(e){if(e.which!=$.FE.KEYCODE.ESC){_edit(e);}});editor.events.on('window.mouseup',_edit);if(editor.helpers.isMobile()){editor.events.$on(editor.$doc,'selectionchange',_edit);}
|
||||
function _init(){editor.events.on('input',function(e){if(e.which!=$.FE.KEYCODE.ESC){_edit(e);}});editor.events.on('window.mouseup',_edit);if(editor.helpers.isMobile()){editor.events.$on(editor.$doc,'selectionchange',_edit);}
|
||||
_initInsertPopup(true);if(editor.el.tagName=='A'){editor.$el.addClass('fr-view');}
|
||||
editor.events.on('toolbar.esc',function(){if(editor.popups.isVisible('link.edit')){editor.events.disableBlur();editor.events.focus();return false;}},true);}
|
||||
function usePredefined(val){var link=editor.opts.linkList[val];var $popup=editor.popups.get('link.insert');var text_inputs=$popup.find('input.fr-link-attr[type="text"]');var check_inputs=$popup.find('input.fr-link-attr[type="checkbox"]');var $input;var i;for(i=0;i<text_inputs.length;i++){$input=$(text_inputs[i]);if(link[$input.attr('name')]){$input.val(link[$input.attr('name')]);}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ this.$el.on('click.command','[data-command]',this.proxy(this.onCommandClick))
|
|||
this.$el.on('click.item','[data-type="media-item"]',this.proxy(this.onItemClick))
|
||||
this.$el.on('touchend','[data-type="media-item"]',this.proxy(this.onItemTouch))
|
||||
this.$el.on('change','[data-control="sorting"]',this.proxy(this.onSortingChanged))
|
||||
this.$el.on('keyup','[data-control="search"]',this.proxy(this.onSearchChanged))
|
||||
this.$el.on('input','[data-control="search"]',this.proxy(this.onSearchChanged))
|
||||
this.$el.on('mediarefresh',this.proxy(this.refresh))
|
||||
this.$el.on('shown.oc.popup','[data-command="create-folder"]',this.proxy(this.onFolderPopupShown))
|
||||
this.$el.on('hidden.oc.popup','[data-command="create-folder"]',this.proxy(this.onFolderPopupHidden))
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
this.$el.on('touchend', '[data-type="media-item"]', this.proxy(this.onItemTouch))
|
||||
|
||||
this.$el.on('change', '[data-control="sorting"]', this.proxy(this.onSortingChanged))
|
||||
this.$el.on('keyup', '[data-control="search"]', this.proxy(this.onSearchChanged))
|
||||
this.$el.on('input', '[data-control="search"]', this.proxy(this.onSearchChanged))
|
||||
this.$el.on('mediarefresh', this.proxy(this.refresh))
|
||||
this.$el.on('shown.oc.popup', '[data-command="create-folder"]', this.proxy(this.onFolderPopupShown))
|
||||
this.$el.on('hidden.oc.popup', '[data-command="create-folder"]', this.proxy(this.onFolderPopupHidden))
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ if (window.jQuery.request !== undefined) {
|
|||
}
|
||||
})
|
||||
|
||||
$(document).on('keyup', 'input[data-request][data-track-input]', function documentOnKeyup(e) {
|
||||
$(document).on('input', 'input[data-request][data-track-input]', function documentOnKeyup(e) {
|
||||
var
|
||||
$el = $(this),
|
||||
lastValue = $el.data('oc.lastvalue')
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
e.preventDefault()
|
||||
})
|
||||
|
||||
$(document).on('keyup', 'div.custom-checkbox', function(e) {
|
||||
$(document).on('input', 'div.custom-checkbox', function(e) {
|
||||
if (e.keyCode == 32) {
|
||||
var $cb = $('input', this)
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@
|
|||
|
||||
this.$src = $(options.inputPreset, parent)
|
||||
|
||||
this.$src.on('keyup', function() {
|
||||
this.$src.on('input', function() {
|
||||
if (self.cancelled)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -2740,7 +2740,7 @@ var opts=$this.data()
|
|||
if(opts.source){opts.source=paramToObj('data-source',opts.source)}
|
||||
$this.autocomplete(opts)})}(window.jQuery);(function($){$(document).on('keydown','div.custom-checkbox',function(e){if(e.keyCode==32)
|
||||
e.preventDefault()})
|
||||
$(document).on('keyup','div.custom-checkbox',function(e){if(e.keyCode==32){var $cb=$('input',this)
|
||||
$(document).on('input','div.custom-checkbox',function(e){if(e.keyCode==32){var $cb=$('input',this)
|
||||
if($cb.data('oc-space-timestamp')==e.timeStamp)
|
||||
return
|
||||
$cb.get(0).checked=!$cb.get(0).checked
|
||||
|
|
@ -4111,7 +4111,7 @@ if($el.val().length&&$el.val()!=prefix)
|
|||
return
|
||||
$el.val(prefix).trigger('oc.inputPreset.afterUpdate')
|
||||
this.$src=$(options.inputPreset,parent)
|
||||
this.$src.on('keyup',function(){if(self.cancelled)
|
||||
this.$src.on('input',function(){if(self.cancelled)
|
||||
return
|
||||
$el.val(prefix+self.formatValue()).trigger('oc.inputPreset.afterUpdate')})
|
||||
this.$src.on('paste',function(){if(self.cancelled)
|
||||
|
|
|
|||
Loading…
Reference in New Issue