Skip to content

Commit

Permalink
Merge pull request #394 from isfs/master
Browse files Browse the repository at this point in the history
Fix caret when currently focused keyboard is refocused with no preview window
  • Loading branch information
Mottie committed Sep 24, 2015
2 parents de9a7b8 + 310b979 commit 8912c48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/jquery.keyboard.extension-caret.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
.appendTo( base.$keyboard );

// remove caret, just-in-case
base.$keyboard.find('.ui-keyboard-caret').remove();
if (base.$caret) base.$caret.remove();
base.$caret = $( '<div class="ui-keyboard-caret ' + o.caretClass + '" style="position:absolute;">' )
.insertAfter( base.$preview );

Expand Down Expand Up @@ -181,6 +181,7 @@
var events = 'keyup keypress mouseup mouseleave '.split( ' ' ).join( namespace + ' ' );
base.$preview.unbind( events );
base.$caret.remove();
base.$caret = null;
base.caret_$div = null;
});

Expand Down

0 comments on commit 8912c48

Please sign in to comment.