mousetrapjs 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Mousetrapjs
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -16,7 +16,7 @@
16
16
  * Mousetrap is a simple keyboard shortcut library for Javascript with
17
17
  * no external dependencies
18
18
  *
19
- * @version 1.1.1
19
+ * @version 1.1.2
20
20
  * @url craig.is/killing/mice
21
21
  */
22
22
  window.Mousetrap = (function() {
@@ -253,7 +253,7 @@ window.Mousetrap = (function() {
253
253
  }
254
254
 
255
255
  // stop for input, select, and textarea
256
- return tag_name == 'INPUT' || tag_name == 'SELECT' || tag_name == 'TEXTAREA'/* || element.getAttribute('contenteditable')*/;
256
+ return tag_name == 'INPUT' || tag_name == 'SELECT' || tag_name == 'TEXTAREA' || (element.contentEditable && element.contentEditable == 'true');
257
257
  }
258
258
 
259
259
  /**
@@ -325,7 +325,7 @@ window.Mousetrap = (function() {
325
325
 
326
326
  // if this is a sequence but it is not at the right level
327
327
  // then move onto the next match
328
- if (callback['seq'] && _sequence_levels[callback['seq']] != callback['level']) {
328
+ if (callback.seq && _sequence_levels[callback.seq] != callback.level) {
329
329
  continue;
330
330
  }
331
331
 
@@ -342,7 +342,7 @@ window.Mousetrap = (function() {
342
342
 
343
343
  // remove is used so if you change your mind and call bind a
344
344
  // second time with a new function the first one is overwritten
345
- if (remove && callback['combo'] == combination) {
345
+ if (remove && callback.combo == combination) {
346
346
  _callbacks[character].splice(i, 1);
347
347
  }
348
348
 
@@ -433,11 +433,11 @@ window.Mousetrap = (function() {
433
433
  // bound such as "g i" and "g t" they both need to fire the
434
434
  // callback for matching g cause otherwise you can only ever
435
435
  // match the first one
436
- if (callbacks[i]['seq']) {
436
+ if (callbacks[i].seq) {
437
437
  processed_sequence_callback = true;
438
438
 
439
439
  // keep a list of which sequences were matches for later
440
- do_not_reset[callbacks[i]['seq']] = 1;
440
+ do_not_reset[callbacks[i].seq] = 1;
441
441
  _fireCallback(callbacks[i].callback, e);
442
442
  continue;
443
443
  }
@@ -518,7 +518,7 @@ window.Mousetrap = (function() {
518
518
  _REVERSE_MAP = {};
519
519
  for (var key in _MAP) {
520
520
 
521
- // pull out the numberic keypad from here cause keypress should
521
+ // pull out the numeric keypad from here cause keypress should
522
522
  // be able to detect the keys from the character
523
523
  if (key > 95 && key < 112) {
524
524
  continue;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mousetrapjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2012-07-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Gem for Mousetrap, a simple library for handling keyboard shortcuts in
15
15
  Javascript