Skip to content

Commit

Permalink
Core: resetDefault option now behaves properly, set default to true. F…
Browse files Browse the repository at this point in the history
…ixes #387
  • Loading branch information
Mottie committed Aug 21, 2015
1 parent 0edc0a5 commit 56e55e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/css/demo.css
Expand Up @@ -64,7 +64,8 @@ button.btn-default:active {
button.btn-default:active:hover {
background-color: #3276B1;
}

/* override bootstrap code highlight */
code { background: #222; }
#showcode {
display: none;
overflow: auto;
Expand Down
2 changes: 2 additions & 0 deletions docs/js/demo.js
Expand Up @@ -124,6 +124,8 @@ jQuery(function($) {
// Custom: Meta Sets
// ********************
$('#meta').keyboard({
// keyboard will open showing last key set used
resetDefault: false,
layout : 'custom',
display: {
'alt' : 'AltGr:It\'s all Greek to me',
Expand Down
5 changes: 4 additions & 1 deletion index.html
Expand Up @@ -442,14 +442,17 @@ <h2>
<textarea id="meta"></textarea>
<br>
<small>
* <a href="//github.com/Mottie/Keyboard/wiki/Setup#typing">Typing</a> extension.
* <a href="//github.com/Mottie/Keyboard/wiki/Setup#typing">Typing</a> extension.<br>
* Keyboard opens showing last keyset.
</small>
<div class="code ui-corner-all">
<h4>HTML</h4>
<pre class="prettyprint lang-html">&lt;textarea id="meta"&gt;&lt;/textarea&gt;</pre>
<h4>Script</h4>
<pre class="prettyprint lang-js">$('#meta')
.keyboard({
// keyboard will open showing last key set used
resetDefault: false,
layout: 'custom',
display: {
'alt' : 'AltGr:It\'s all Greek to me',
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.keyboard.js
Expand Up @@ -297,8 +297,8 @@ var $keyboard = $.keyboard = function(el, options){

if (o.resetDefault) {
base.shiftActive = base.altActive = base.metaActive = false;
base.showSet();
}
base.showSet();

// beforeVisible event
base.$el.trigger( $keyboard.events.kbBeforeVisible, [ base, base.el ] );
Expand Down Expand Up @@ -2204,7 +2204,7 @@ var $keyboard = $.keyboard = function(el, options){
repeatRate : 20,

// resets the keyboard to the default keyset when visible
resetDefault : false,
resetDefault : true,

// Event (namespaced) on the input to reveal the keyboard. To disable it, just set it to ''.
openOn : 'focus',
Expand Down

0 comments on commit 56e55e5

Please sign in to comment.