hooch 0.15.28 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/hooch.js +21 -16
- data/lib/hooch/hooch_helper.rb +10 -1
- data/lib/hooch/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 168d4128131eb0aaefe037ae38a2b7a4cbf8274f73d294bb2b891e9f879425ab
|
4
|
+
data.tar.gz: bdd68a50fedff639930c316bbbd7dc1fd1d024dd034416b7007fbfef6310c745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2b36a4cb2e43b8058f08189464e5d76ab2ff53597744438091e8b683bdbb2411b5c6c374fd87db7bf48ae7666bcf14dc73904d0b114d2eb86813c2fc8adce43
|
7
|
+
data.tar.gz: 2ddd5eefa06924f24d86439e16e7fc5a9af6a20bdaa4b683abab8867d132bf4e7c76d564a88bfbe5080b1749f88c9243be56299df3f0374941ec1fae62cf3aa2
|
@@ -187,10 +187,11 @@ var initHooch = function(){
|
|
187
187
|
init: function($modal_trigger){
|
188
188
|
this.$modal_trigger = $modal_trigger
|
189
189
|
this.$modal_content = $($modal_trigger.data('content-target'))
|
190
|
+
this.dismissable = $modal_trigger.data('dismissable')
|
190
191
|
var modal_trigger = this
|
191
192
|
$modal_trigger.on('click', function(){
|
192
193
|
modal_trigger.instantiate('before')
|
193
|
-
new hooch.Modal(modal_trigger.$modal_content)
|
194
|
+
new hooch.Modal(modal_trigger.$modal_content, this.dismissable)
|
194
195
|
modal_trigger.instantiate('after')
|
195
196
|
})
|
196
197
|
},
|
@@ -223,8 +224,9 @@ var initHooch = function(){
|
|
223
224
|
}
|
224
225
|
}),
|
225
226
|
Modal: Class.extend({
|
226
|
-
init: function($modal_content){
|
227
|
+
init: function($modal_content,dismissable){
|
227
228
|
this.$modal_content = $modal_content
|
229
|
+
this.dismissable = dismissable
|
228
230
|
this.getMask()
|
229
231
|
this.getDismisser()
|
230
232
|
this.getContentWrapper()
|
@@ -235,27 +237,23 @@ var initHooch = function(){
|
|
235
237
|
this.$modal_content.trigger('modalVisible')
|
236
238
|
},
|
237
239
|
getMask: function(){
|
238
|
-
this.mask_top = $(window).scrollTop()
|
239
|
-
this.mask_height = $(window).height()
|
240
240
|
this.$modal_mask = $('#hooch-mask')
|
241
|
-
this.$modal_mask.css({height: this.mask_height + 'px', top: this.mask_top + 'px',
|
242
|
-
position: 'absolute', 'z-index': 100000,
|
243
|
-
left: 0, right: 0, bottom: 0
|
244
|
-
})
|
245
241
|
},
|
246
242
|
getContentWrapper: function(){
|
247
243
|
this.$modal_wrapper = this.$modal_mask.find('#hooch-modal')
|
248
|
-
this.$
|
249
|
-
this.$modal_wrapper.html(this.$modal_element)
|
250
|
-
this.$modal_element.html(this.$modal_content)
|
244
|
+
this.$modal_wrapper.html(this.$modal_content)
|
251
245
|
this.$modal_content.show()
|
252
246
|
},
|
253
247
|
getDismisser: function(){
|
254
|
-
this
|
248
|
+
if(this.dismissable){
|
249
|
+
this.$dismisser = this.$modal_mask.find('#hooch-dismiss')
|
250
|
+
}
|
255
251
|
},
|
256
252
|
attachDismisser: function(){
|
257
|
-
this
|
258
|
-
|
253
|
+
if(this.dismissable){
|
254
|
+
this.$modal_wrapper.append(this.$dismisser)
|
255
|
+
this.dismisser = new hooch.ModalDismisser(this.$dismisser,this)
|
256
|
+
}
|
259
257
|
},
|
260
258
|
close: function(){
|
261
259
|
this.$modal_mask.hide()
|
@@ -278,6 +276,13 @@ var initHooch = function(){
|
|
278
276
|
hooch.dismisser.dismissModal()
|
279
277
|
}
|
280
278
|
},
|
279
|
+
ModalNow: Class.extend({
|
280
|
+
init: function($modal_trigger){
|
281
|
+
this.$modal_content = $($modal_trigger.data('content-target'))
|
282
|
+
this.dismissable = $modal_trigger.data('dismissable')
|
283
|
+
new hooch.Modal(this.$modal_content, this.dismissable)
|
284
|
+
}
|
285
|
+
}),
|
281
286
|
Expandable: Class.extend({
|
282
287
|
init: function($expandable){
|
283
288
|
var expandable = this;
|
@@ -930,7 +935,7 @@ var initHooch = function(){
|
|
930
935
|
}),
|
931
936
|
ReloadPage: Class.extend({
|
932
937
|
init: function(reload_page){
|
933
|
-
window.location.
|
938
|
+
window.location.assign(reload_page);
|
934
939
|
}
|
935
940
|
}),
|
936
941
|
PageReloader: Class.extend({
|
@@ -2281,7 +2286,7 @@ var initHooch = function(){
|
|
2281
2286
|
['hover_overflow','hidey_button','hide-show','submit-proxy','click-proxy','field-filler','revealer',
|
2282
2287
|
'checkbox-hidden-proxy','prevent-double-submit','prevent-double-link-click', 'tab-group',
|
2283
2288
|
'hover-reveal', 'emptier', 'remover', 'checkbox-proxy', 'fake-checkbox', 'fake-select', 'select-action-changer',
|
2284
|
-
'sorter', 'sort-element', 'bind-key','modal-trigger','history-pusher', 'history-replacer', 'link', 'atarget',
|
2289
|
+
'sorter', 'sort-element', 'bind-key','modal-trigger','modal-now','history-pusher', 'history-replacer', 'link', 'atarget',
|
2285
2290
|
'page-reloader'],'hooch');
|
2286
2291
|
window.any_time_manager.load();
|
2287
2292
|
};
|
data/lib/hooch/hooch_helper.rb
CHANGED
@@ -33,9 +33,18 @@ module Hooch
|
|
33
33
|
attrs = 'data-tab-id=' + id
|
34
34
|
end
|
35
35
|
|
36
|
-
def modal_trigger(target)
|
36
|
+
def modal_trigger(target, dismissable: true)
|
37
37
|
attrs = 'data-modal-trigger=true'
|
38
38
|
attrs += " data-content-target=#{target}"
|
39
|
+
attrs += " data-dismissable=true" if dismissable
|
40
|
+
attrs
|
41
|
+
end
|
42
|
+
|
43
|
+
def modal_now(target, dismissable: true)
|
44
|
+
attrs = 'data-modal-now=true'
|
45
|
+
attrs += " data-content-target=#{target}"
|
46
|
+
attrs += " data-dismissable=true" if dismissable
|
47
|
+
attrs
|
39
48
|
end
|
40
49
|
|
41
50
|
def hide_show(target, any_click_closes: false)
|
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.
|
4
|
+
version: 0.16.0
|
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-
|
11
|
+
date: 2018-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.7.7
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Tools for building a browser UI. Get the good stuff.
|