hooch 0.15.7 → 0.15.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hooch.js +30 -10
- data/lib/hooch/hooch_helper.rb +18 -0
- data/lib/hooch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a437cee1cc33add2513ae37edd278d6557676acb
|
4
|
+
data.tar.gz: 6d0db3e2a9a93498c6becdf702557b9ebe32ddc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc02fb9dc775f020f9d4e3d1d179888fcf543d3ec654db20d9ecb375de2ff7fd60ad411bb9867fe01bcec8f330e86e684565ec0da91e315c5a992c50778bec9b
|
7
|
+
data.tar.gz: 0c04c2cf50697cc3b34ae9a44d79a949f18e6b7d03e411710a3d8655349bc6f7d2c7fa5eb1b1a5539c143bdb2ce18e5450726fdb152e01f7ae702ebc771f1f36
|
@@ -1048,15 +1048,19 @@ var initHooch = function(){
|
|
1048
1048
|
this.$sorter = $sorter
|
1049
1049
|
this.$jq_obj = $sorter
|
1050
1050
|
$sorter.data('sorter',this)
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1051
|
+
//////////////////////////////////////////
|
1052
|
+
// Helpful for debugging in the browser
|
1053
|
+
// var new_uuid = new UUID
|
1054
|
+
// this.uniq_id = new_uuid.value
|
1055
|
+
// this.created_at = new Date()
|
1056
|
+
//////////////////////////////////////////
|
1054
1057
|
this.is_visible = $sorter.is(':visible')
|
1055
1058
|
if(this.is_visible){
|
1056
1059
|
this.setWidth()
|
1057
1060
|
this.setBoundaries()
|
1058
1061
|
this.getSortElements()
|
1059
1062
|
}
|
1063
|
+
this.getSendSort()
|
1060
1064
|
this.startInactivityRefresh()
|
1061
1065
|
var sorter = this
|
1062
1066
|
$(window).on('mouseup touchend touchcancel', function(e){
|
@@ -1564,6 +1568,13 @@ var initHooch = function(){
|
|
1564
1568
|
setTimeout(function(){sorter.inactivityRefresh()}, 60000);
|
1565
1569
|
}
|
1566
1570
|
},
|
1571
|
+
getSendSort: function(){
|
1572
|
+
let send_sort_now = this.$sorter.find('[data-send-sort-now]')
|
1573
|
+
let sorter = this
|
1574
|
+
send_sort_now.on('click', function(){
|
1575
|
+
sorter.sendSort()
|
1576
|
+
})
|
1577
|
+
},
|
1567
1578
|
disable: function(){
|
1568
1579
|
this.disabled = true
|
1569
1580
|
}
|
@@ -1571,9 +1582,12 @@ var initHooch = function(){
|
|
1571
1582
|
SortElement: Class.extend({
|
1572
1583
|
init: function($sort_element,sorter){
|
1573
1584
|
this.$jq_obj = $sort_element
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1585
|
+
//////////////////////////////////////////
|
1586
|
+
// Helpful for debugging in the browser:
|
1587
|
+
// var new_uuid = new UUID
|
1588
|
+
// this.uniq_id = new_uuid.value
|
1589
|
+
// this.created_at = new Date()
|
1590
|
+
//////////////////////////////////////////
|
1577
1591
|
if(sorter) this.sorter = sorter;
|
1578
1592
|
$sort_element.data('hooch.SortElement', this)
|
1579
1593
|
this.$sort_element = $sort_element;
|
@@ -1942,7 +1956,11 @@ var initHooch = function(){
|
|
1942
1956
|
hooch.SortPlaceholder = hooch.SortElement.extend({
|
1943
1957
|
init: function($sort_element,sort_element){
|
1944
1958
|
var new_uuid = new UUID
|
1945
|
-
|
1959
|
+
//////////////////////////////////////////
|
1960
|
+
// Helpful for debugging in the browser
|
1961
|
+
// this.uniq_id = new_uuid.value
|
1962
|
+
//////////////////////////////////////////
|
1963
|
+
|
1946
1964
|
$sort_element.data('hooch.SortElement', this)
|
1947
1965
|
this.sort_element = sort_element
|
1948
1966
|
this.sorter = sort_element.sorter;
|
@@ -2239,9 +2257,11 @@ var initHooch = function(){
|
|
2239
2257
|
})
|
2240
2258
|
});
|
2241
2259
|
$(document).ajaxStop(function(){
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2260
|
+
if(window.any_time_manager.recordedObjects.hasOwnProperty('hooch.Sorter')){
|
2261
|
+
$.each(window.any_time_manager.recordedObjects['hooch.Sorter'], function(index, sorter){
|
2262
|
+
sorter.setBoundaries()
|
2263
|
+
})
|
2264
|
+
}
|
2245
2265
|
})
|
2246
2266
|
}
|
2247
2267
|
if(typeof Class === "undefined"){
|
data/lib/hooch/hooch_helper.rb
CHANGED
@@ -261,5 +261,23 @@ module Hooch
|
|
261
261
|
def bind_key_attrs(key_name)
|
262
262
|
"data-bind-key=\"#{key_name}\"".html_safe
|
263
263
|
end
|
264
|
+
|
265
|
+
def sorter(polymorphic_id: nil, recipient_filters: nil, href: nil)
|
266
|
+
attrs = "data-sorter=true"
|
267
|
+
attrs += " data-recipient-filters=#{recipient_filters}" if recipient_filters
|
268
|
+
attrs += " data-polymorphic-id=#{polymorphic_id}" if polymorphic_id
|
269
|
+
attrs += " href=#{href}" if href
|
270
|
+
attrs
|
271
|
+
end
|
272
|
+
|
273
|
+
def solo_sort_element(reusable: false, target_filters: nil)
|
274
|
+
attrs = "data-sort-element=true"
|
275
|
+
attrs += " data-target-filters=#{target_filters}" if target_filters
|
276
|
+
attrs
|
277
|
+
end
|
278
|
+
|
279
|
+
def send_sort_now
|
280
|
+
"data-send-sort-now"
|
281
|
+
end
|
264
282
|
end
|
265
283
|
end
|
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.15.
|
4
|
+
version: 0.15.8
|
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-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|