hooch 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c92813e77c493bb42d1d5c0bc0800ee1d8e1834
4
- data.tar.gz: a058ced5416ddd9b7a6e14fa5575ff000f6e51fc
3
+ metadata.gz: a6c8d1dade71b40b3506513ed1dd4a2218be8ab4
4
+ data.tar.gz: f516b2a7ccbff0f1db97c4a82b53acc507aade37
5
5
  SHA512:
6
- metadata.gz: 333e657decbee392ddf437eae2ea5defcd912c2011d3b1b454f5834819b30009083c950b53bdbd5594a66413b474a24c3174ae957e81d6558e746a031581f341
7
- data.tar.gz: d256173242f5a45f00733e45c619394924fc53ae938face381007c6f27825124cde94b45bc332f97d48dc5b5473cdef59c10c516f8ff0bad18978e94630470cf
6
+ metadata.gz: 62f0322607b5edc25523392e9594706cb3747c59d2d77003b3047dde5ff60040bef77be6bc223b1eab485be32d781281acd7a6833356ce28478d0f09c20068d5
7
+ data.tar.gz: 62c8e576de49da0c5e68c95c19e1a2b859e9f9ec8d4c9043ed7c32cdf5431128415c79d73b2dbbd1cdf5c213d79b0f4f72066fd6575ebc060bccdd74071ac64f
@@ -1173,27 +1173,31 @@ var initHooch = function(){
1173
1173
  $(window).on('keyup', function(e){key_binder.do_it_now(e)} )
1174
1174
  },
1175
1175
  do_it_now: function(e){
1176
- if(this.key_code == e.keyCode){
1177
- e.preventDefault
1178
- switch(this.element_type){
1179
- case 'a':
1180
- if(this.$bound_element.data('ajax-target')){
1181
- this.$bound_element.click()
1182
- } else {
1183
- window.location = this.$bound_element.attr('href')
1184
- }
1185
- break;
1186
- case 'form':
1187
- this.$bound_element.submit()
1188
- break;
1189
- case 'input':
1190
- if('submit' == $this.$bound_element.prop('type')){
1176
+ var focussed_elem_name = document.activeElement.nodeName.toLowerCase()
1177
+ if('textarea' != focussed_elem_name && ('input' != focussed_elem_name ||
1178
+ 'submit' == $(document.activeElement).prop('type'))){
1179
+ if(this.key_code == e.keyCode){
1180
+ e.preventDefault
1181
+ switch(this.element_type){
1182
+ case 'a':
1183
+ if(this.$bound_element.data('ajax-target')){
1191
1184
  this.$bound_element.click()
1185
+ } else {
1186
+ window.location = this.$bound_element.attr('href')
1192
1187
  }
1193
- default:
1194
- break;
1188
+ break;
1189
+ case 'form':
1190
+ this.$bound_element.submit()
1191
+ break;
1192
+ case 'input':
1193
+ if('submit' == $this.$bound_element.prop('type')){
1194
+ this.$bound_element.click()
1195
+ }
1196
+ default:
1197
+ break;
1198
+ }
1199
+ return false
1195
1200
  }
1196
- return false
1197
1201
  }
1198
1202
  }
1199
1203
  })
data/lib/hooch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -116,20 +116,20 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '3'
119
+ version: '1'
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: '4'
122
+ version: '2'
123
123
  type: :development
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '3'
129
+ version: '1'
130
130
  - - "<"
131
131
  - !ruby/object:Gem::Version
132
- version: '4'
132
+ version: '2'
133
133
  description: Hooch provides tools for common UI patterns without any dom or css. You
134
134
  build the html and css you want, then add data-attributes to get behavior. Keep
135
135
  behavior independent of look-and-feel and you can build "anything**"(** within reason).