hooch 0.16.0 → 0.16.1
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 +4 -4
- data/app/assets/javascripts/hooch.js +27 -6
- data/lib/hooch/hooch_helper.rb +8 -1
- data/lib/hooch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78480ee426a832313d8a0a6e84d4c2b9f6ed0ce0216720028ca15bd192846de4
|
4
|
+
data.tar.gz: 9e3cdd66fad8bd4a296b05fbb0d29490ff685664c3e7c75b5f77e0636d6e25a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbbebdaf8ca8a714e818382d32db61a66172c5427c2c1a37086779df11cbfe955f7459ba83085bee7509ef2a787a6a71ad4f10235759346a7ffa830c41723ddb
|
7
|
+
data.tar.gz: 777045c9603eaeace7bb9c26e241cc2d9cc47954d66d25f00060f1b7061a18d96fa5367795208c3a0c1d3e14f2c1cb6ac861213c153f64a5e28963840a3d5052
|
@@ -234,6 +234,7 @@ var initHooch = function(){
|
|
234
234
|
this.disableScroll()
|
235
235
|
this.$modal_content.trigger('modalInitialized')
|
236
236
|
this.$modal_mask.show()
|
237
|
+
hooch.current_modal = this
|
237
238
|
this.$modal_content.trigger('modalVisible')
|
238
239
|
},
|
239
240
|
getMask: function(){
|
@@ -245,14 +246,12 @@ var initHooch = function(){
|
|
245
246
|
this.$modal_content.show()
|
246
247
|
},
|
247
248
|
getDismisser: function(){
|
248
|
-
|
249
|
-
|
250
|
-
}
|
249
|
+
this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
|
250
|
+
this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
|
251
251
|
},
|
252
252
|
attachDismisser: function(){
|
253
253
|
if(this.dismissable){
|
254
254
|
this.$modal_wrapper.append(this.$dismisser)
|
255
|
-
this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
|
256
255
|
}
|
257
256
|
},
|
258
257
|
close: function(){
|
@@ -276,11 +275,33 @@ var initHooch = function(){
|
|
276
275
|
hooch.dismisser.dismissModal()
|
277
276
|
}
|
278
277
|
},
|
278
|
+
attachModalDismisser: function(){
|
279
|
+
if(hooch.current_modal){
|
280
|
+
hooch.current_modal.dismissable = true
|
281
|
+
hooch.current_modal.attachDismisser()
|
282
|
+
}
|
283
|
+
},
|
279
284
|
ModalNow: Class.extend({
|
280
285
|
init: function($modal_trigger){
|
281
286
|
this.$modal_content = $($modal_trigger.data('content-target'))
|
287
|
+
this.delay = $modal_trigger.data('delay')
|
282
288
|
this.dismissable = $modal_trigger.data('dismissable')
|
283
|
-
|
289
|
+
var modal_now = this
|
290
|
+
if(this.delay > 0){
|
291
|
+
setTimeout(function(){new hooch.Modal(modal_now.$modal_content, modal_now.dismissable)}, delay)
|
292
|
+
} else {
|
293
|
+
new hooch.Modal(this.$modal_content, this.dismissable)
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}),
|
297
|
+
ModalCloser: Class.extend({
|
298
|
+
init: function($modal_closer){
|
299
|
+
var milliseconds = $modal_closer.data('milliseconds')
|
300
|
+
if(milliseconds > 0){
|
301
|
+
setTimeout(function(){hooch.closeModal()},milliseconds)
|
302
|
+
} else {
|
303
|
+
hooch.closeModal()
|
304
|
+
}
|
284
305
|
}
|
285
306
|
}),
|
286
307
|
Expandable: Class.extend({
|
@@ -2286,7 +2307,7 @@ var initHooch = function(){
|
|
2286
2307
|
['hover_overflow','hidey_button','hide-show','submit-proxy','click-proxy','field-filler','revealer',
|
2287
2308
|
'checkbox-hidden-proxy','prevent-double-submit','prevent-double-link-click', 'tab-group',
|
2288
2309
|
'hover-reveal', 'emptier', 'remover', 'checkbox-proxy', 'fake-checkbox', 'fake-select', 'select-action-changer',
|
2289
|
-
'sorter', 'sort-element', 'bind-key','modal-trigger','modal-now','history-pusher', 'history-replacer', 'link', 'atarget',
|
2310
|
+
'sorter', 'sort-element', 'bind-key','modal-trigger','modal-now','modal-closer','history-pusher', 'history-replacer', 'link', 'atarget',
|
2290
2311
|
'page-reloader'],'hooch');
|
2291
2312
|
window.any_time_manager.load();
|
2292
2313
|
};
|
data/lib/hooch/hooch_helper.rb
CHANGED
@@ -40,13 +40,20 @@ module Hooch
|
|
40
40
|
attrs
|
41
41
|
end
|
42
42
|
|
43
|
-
def modal_now(target, dismissable: true)
|
43
|
+
def modal_now(target, dismissable: true, delay: 0)
|
44
44
|
attrs = 'data-modal-now=true'
|
45
45
|
attrs += " data-content-target=#{target}"
|
46
|
+
attrs += " data-delay=#{delay}"
|
46
47
|
attrs += " data-dismissable=true" if dismissable
|
47
48
|
attrs
|
48
49
|
end
|
49
50
|
|
51
|
+
def modal_closer(milliseconds: 0)
|
52
|
+
attrs = 'data-modal-closer=true'
|
53
|
+
attrs += " data-milliseconds=#{milliseconds}"
|
54
|
+
attrs
|
55
|
+
end
|
56
|
+
|
50
57
|
def hide_show(target, any_click_closes: false)
|
51
58
|
{}.tap do |params|
|
52
59
|
params['data-hide-show'] = true
|
data/lib/hooch/version.rb
CHANGED
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.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|