hooch 0.15.5 → 0.15.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9876e5f45245c44802ba0cbe47f1ca8e8e92a1b5
4
- data.tar.gz: 2a2dd7ce0ec572babd8fc0e10399b12dcd1d8476
3
+ metadata.gz: 2e3f1b9d7339e2d1be9f15bad2fbeb1059b9b46b
4
+ data.tar.gz: e2066d2c7d3851d1e2fdc961f57b25eda8b2099a
5
5
  SHA512:
6
- metadata.gz: c53a91ed15018c648bb3dadb61ce57273bc15a6f3df49041a81b2f1114372e83f27fbb171058dbe0a3ca7bdc9352e65ab96d29cef4c3a9d6018c627e59a482c1
7
- data.tar.gz: 855c432af0be3e584b849112c0bac3fc0c25f2d4d713ec655f599348a30010620e7a402435e02598c9df964a1617543413a868c204ee659b2a2f51b85d9860a6
6
+ metadata.gz: 9ac4ca63cbe12bb1af6a1d0dbd978c19ec82fa2130aaf060c5bd034adf63287ae0d09e762c11606215824d4a3602bdd7aa848ec8edd8d4ea0deb44f488247576
7
+ data.tar.gz: c82ce45e3da8fe04c8d353be692167b5c2fb14060ac785f8c797177d4cce77d87d30d9be6bf70a5654f865b42afec5401350430a91386c5bbfcfd6205a7f4ca9
@@ -134,11 +134,17 @@ var initHooch = function(){
134
134
  ModalDismisser: Class.extend({
135
135
  init: function($dismisser,modal_mask){
136
136
  var dismisser = this
137
+ this.$dismisser = $dismisser;
138
+ hooch.dismisser = this
137
139
  this.modal_mask = modal_mask
138
140
  $dismisser.css({cursor: 'pointer'})
139
141
  $dismisser.on('click', function(){
140
- dismisser.modal_mask.close()
142
+ dismisser.dismissModal()
141
143
  })
144
+ },
145
+ dismissModal: function(){
146
+ hooch.dismisser = null
147
+ this.modal_mask.close()
142
148
  }
143
149
  }),
144
150
  Modal: Class.extend({
@@ -147,6 +153,7 @@ var initHooch = function(){
147
153
  this.getMask()
148
154
  this.getDismisser()
149
155
  this.getContentWrapper()
156
+ this.attachDismisser()
150
157
  this.disableScroll()
151
158
  this.$modal_content.trigger('modalInitialized')
152
159
  this.$modal_mask.show()
@@ -162,14 +169,18 @@ var initHooch = function(){
162
169
  })
163
170
  },
164
171
  getContentWrapper: function(){
165
- this.$modal_element = this.$modal_mask.find('#hooch-modal')
166
- this.$modal_element.append(this.$modal_content)
172
+ this.$modal_wrapper = this.$modal_mask.find('#hooch-modal')
173
+ this.$modal_element = $('<div/>', {id: 'hooch_content', style: 'position: relative; float: left;'})
174
+ this.$modal_wrapper.html(this.$modal_element)
175
+ this.$modal_element.html(this.$modal_content)
167
176
  this.$modal_content.show()
168
177
  },
169
178
  getDismisser: function(){
170
179
  this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
180
+ },
181
+ attachDismisser: function(){
182
+ this.$modal_wrapper.append(this.$dismisser)
171
183
  this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
172
- this.$modal_content.append(this.$dismisser)
173
184
  },
174
185
  close: function(){
175
186
  this.$modal_mask.hide()
@@ -212,6 +223,11 @@ var initHooch = function(){
212
223
  document.onkeydown = null;
213
224
  }
214
225
  }),
226
+ closeModal: function(){
227
+ if(hooch.dismisser){
228
+ hooch.dismisser.dismissModal()
229
+ }
230
+ },
215
231
  Expandable: Class.extend({
216
232
  init: function($expandable){
217
233
  var expandable = this;
@@ -1835,8 +1851,12 @@ var initHooch = function(){
1835
1851
  if(e.preventDefault) e.preventDefault();
1836
1852
  e.cancelBubble=true;
1837
1853
  e.returnValue=false;
1838
- }
1839
-
1854
+ };
1855
+ hooch.isTouchDevice = function(){
1856
+ var el = document.createElement('div');
1857
+ el.setAttribute('ongesturestart', 'return;');
1858
+ return typeof el.ongesturestart === "function";
1859
+ };
1840
1860
  //https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
1841
1861
  hooch.beginning_params = (function(a) {
1842
1862
  if (a == "") return {};
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.15.5"
2
+ VERSION = "0.15.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-09 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails