hooch 0.16.16 → 0.16.18

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
  SHA256:
3
- metadata.gz: a70ea5ba733c415cb5c371af84b1f1655d850752a48f94a5263c4ec5f39fac57
4
- data.tar.gz: 87d09af2a4c46a246b7a68c9fbb3a3bb5bab02545b0124b9e782de3e836e12cd
3
+ metadata.gz: 60f55de30e97bcbc1041b295244daef1ca96baa58b700c4f78bdb1d850f04a47
4
+ data.tar.gz: 86bedbd24868783f5cf8545ce961b8a5bfe7e3ecd2f3a4b41dbe1af222683ab5
5
5
  SHA512:
6
- metadata.gz: 30da0adb4324f0584edc35a1ea2c3f2b1dc0289c3ec33b7c4e03943d27eff5195d1f340b809ab2398719d213ae495f72dbbfb2ae3742996ed3220e2c8a9f5164
7
- data.tar.gz: 59ea8ba01a1ac73073e1089ed73ec95bae1a39d6276f843ca9f68a4bcd4136f68e17b41aee5907d015ef869ba3da9f15622cd7846bc1691a36ecf93fae9fe982
6
+ metadata.gz: ffc4bb125afb14cc97fcac9d9aa3be9067db38e533964a8c377e0c0ee54c01be3aceb4bf4afcae344afac8e3e14a19cedc64c414e507ac01a538d3a2b1c16df8
7
+ data.tar.gz: 2036078fbe86a085b4e46175a656b9b274e0156f9ec9fdb2c676b2fcd36a1947d2c6634768d5e1e283792138aca42f118852736643b62f3cdddc728445ccf274
@@ -220,21 +220,33 @@ var initHooch = function(){
220
220
  },
221
221
  dismissModal: function(){
222
222
  hooch.dismisser = null
223
- this.modal.close()
223
+ hooch.current_modal.close()
224
224
  }
225
225
  }),
226
226
  Modal: Class.extend({
227
227
  init: function($modal_content,dismissable){
228
- this.$modal_content = $modal_content
229
- this.dismissable = dismissable
228
+ if(!hooch.current_modal){
229
+ hooch.current_modal = new hooch.SingletonModal()
230
+ }
231
+ hooch.current_modal.load($modal_content,dismissable)
232
+ }
233
+ }),
234
+ SingletonModal: Class.extend({
235
+ init: function($modal_content){
230
236
  this.getMask()
231
- this.getDismisser()
232
237
  this.getContentWrapper()
238
+ this.getDismisser()
239
+ },
240
+ load: function($modal_content,dismissable){
241
+ this.$modal_content = $modal_content
242
+ this.dismissable = dismissable
243
+ this.$modal_wrapper.html(this.$modal_content)
244
+ this.$modal_wrapper.append(this.$dismisser)
245
+ this.$modal_content.show()
233
246
  this.attachDismisser()
234
247
  this.disableScroll()
235
248
  this.$modal_content.trigger('modalInitialized')
236
249
  this.showModal()
237
- hooch.current_modal = this
238
250
  this.$modal_content.trigger('modalVisible')
239
251
  },
240
252
  getMask: function(){
@@ -242,17 +254,14 @@ var initHooch = function(){
242
254
  },
243
255
  getContentWrapper: function(){
244
256
  this.$modal_wrapper = this.$modal_mask.find('#hooch-modal')
245
- this.$modal_wrapper.html(this.$modal_content)
246
- this.$modal_content.show()
247
257
  },
248
258
  getDismisser: function(){
249
- this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
250
- this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
259
+ this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
260
+ this.$dismisser.on('click', function(){hooch.current_modal.close()})
251
261
  },
252
262
  attachDismisser: function(){
253
263
  if(this.dismissable){
254
264
  this.$dismisser.show()
255
- this.$modal_wrapper.append(this.$dismisser)
256
265
  } else {
257
266
  this.$dismisser.hide()
258
267
  }
@@ -262,6 +271,7 @@ var initHooch = function(){
262
271
  this.$modal_mask.show()
263
272
  },
264
273
  close: function(){
274
+ this.$dismisser.detach()
265
275
  this.$modal_mask.hide()
266
276
  this.$modal_content.hide()
267
277
  this.enableScroll()
@@ -288,8 +298,8 @@ var initHooch = function(){
288
298
  }
289
299
  }),
290
300
  closeModal: function(){
291
- if(hooch.dismisser){
292
- hooch.dismisser.dismissModal()
301
+ if(hooch.current_modal){
302
+ hooch.current_modal.close()
293
303
  }
294
304
  },
295
305
  attachModalDismisser: function(){
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.16.16"
2
+ VERSION = "0.16.18"
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.16.16
4
+ version: 0.16.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails