Skip to content
This repository
Browse code

fixed unbind method to not remove all bound events. Fixes #74

  • Loading branch information...
commit beb9247284afbc092406e6d0e8ea34feb346b820 1 parent 07907c0
Rob G authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +5 3 js/jquery.keyboard.js
8 js/jquery.keyboard.js
@@ -206,7 +206,9 @@ $.keyboard = function(el, options){
206 206 }
207 207
208 208 // Unbind focus to prevent recursion - openOn may be empty if keyboard is opened externally
209   - base.$el.unbind( (o.openOn) ? o.openOn + '.keyboard' : '');
  209 + if (o.openOn) {
  210 + base.$el.unbind( o.openOn + '.keyboard' );
  211 + }
210 212
211 213 // build keyboard if it doesn't exist
212 214 if (typeof(base.$keyboard) === 'undefined') { base.startup(); }
@@ -999,9 +1001,9 @@ $.keyboard = function(el, options){
999 1001 base.destroy = function() {
1000 1002 $(document).unbind('mousedown.keyboard keyup.keyboard');
1001 1003 if (base.$keyboard) { base.$keyboard.remove(); }
1002   - var unb = o.openOn + ' accepted beforeClose blur canceled change contextmenu hidden initialized keydown keypress keyup visible'.split(' ').join('.keyboard ');
  1004 + var unb = $.trim(o.openOn + ' accepted beforeClose blur canceled change contextmenu hidden initialized keydown keypress keyup visible').split(' ').join('.keyboard ');
1003 1005 base.$el
1004   - .removeClass('ui-keyboard-input ui-keyboard-placeholder ui-keyboard-notallowed ui-keyboard-always-open ' + o.css.input)
  1006 + .removeClass('ui-keyboard-input ui-keyboard-lockedinput ui-keyboard-placeholder ui-keyboard-notallowed ui-keyboard-always-open ' + o.css.input)
1005 1007 .removeAttr('aria-haspopup')
1006 1008 .removeAttr('role')
1007 1009 .unbind( unb + '.keyboard')

0 comments on commit beb9247

Please sign in to comment.
Something went wrong with that request. Please try again.