hooch 0.15.17 → 0.15.18
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 -16
- 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: 8a889eef8d20772bb1c2e79e8950b171afed9e49
|
4
|
+
data.tar.gz: 99af2a2ef4c9569962745436fbddf2a8922d37da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f42ee4fbf309d9c68ddfed75b97ce7f44af39f348c5036f6314b076b9e4438ed94e5a6012d40e4dd33860f0afb40b64910de050cd72226c94e220e38e215031
|
7
|
+
data.tar.gz: dc8cb30d4861bae12923e71689447be83182a23f133dffa9ac09dab5805b5b9576461f3e2e0eb17853825403b11eaa33b26d9b7f01725e0c870c12496715a924
|
@@ -45,6 +45,17 @@ Set.from_iterable = function(arr) {
|
|
45
45
|
}
|
46
46
|
return new_set
|
47
47
|
}
|
48
|
+
if(typeof UUID == 'undefined'){
|
49
|
+
var UUID = Class.extend({
|
50
|
+
init: function(){
|
51
|
+
this.value = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
52
|
+
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
53
|
+
return v.toString(16);
|
54
|
+
});
|
55
|
+
}
|
56
|
+
})
|
57
|
+
|
58
|
+
}
|
48
59
|
var initHooch = function(){
|
49
60
|
hooch = {
|
50
61
|
Emptier: Class.extend({
|
@@ -1173,12 +1184,8 @@ var initHooch = function(){
|
|
1173
1184
|
var sorter = this;
|
1174
1185
|
this.$sort_elements.each(function(){
|
1175
1186
|
if($(this).data('hooch.SortElement')){
|
1176
|
-
|
1177
|
-
|
1178
|
-
// var sort_element = tmp_sort_element.sort_element
|
1179
|
-
// } else {
|
1180
|
-
var sort_element = tmp_sort_element
|
1181
|
-
// }
|
1187
|
+
var sort_element = $(this).data('hooch.SortElement')
|
1188
|
+
sort_element.refreshAfterPossibleMutation()
|
1182
1189
|
} else {
|
1183
1190
|
var sort_element = new hooch.SortElement($(this),sorter)
|
1184
1191
|
}
|
@@ -1508,7 +1515,7 @@ var initHooch = function(){
|
|
1508
1515
|
} else {
|
1509
1516
|
var first_id = id_array[0]
|
1510
1517
|
var last_underscore_location = first_id.lastIndexOf('_')
|
1511
|
-
var array_name = first_id.slice(0,last_underscore_location)
|
1518
|
+
var array_name = first_id.slice(0,last_underscore_location)
|
1512
1519
|
form_data[array_name] = id_array.map(function(id){
|
1513
1520
|
return id.slice((last_underscore_location + 1))
|
1514
1521
|
})
|
@@ -1580,7 +1587,7 @@ var initHooch = function(){
|
|
1580
1587
|
// None of these can be present to match
|
1581
1588
|
var none = true
|
1582
1589
|
for(var key in element_filters.none){
|
1583
|
-
if(!this.recipient_filters.hasOwnProperty(key))
|
1590
|
+
if(!this.recipient_filters.hasOwnProperty(key)) continue
|
1584
1591
|
var exclude_source = Set.from_iterable(this.recipient_filters[key])
|
1585
1592
|
var exclude_test = Set.from_iterable(element_filters.none[key])
|
1586
1593
|
if(exclude_source.intersection(exclude_test).size != 0){
|
@@ -1629,10 +1636,7 @@ var initHooch = function(){
|
|
1629
1636
|
var send_sort_now = this.$sorter.find('[data-send-sort-now]')
|
1630
1637
|
var sorter = this
|
1631
1638
|
if(send_sort_now.length > 0){
|
1632
|
-
console.log('got send sort:')
|
1633
|
-
console.log(this.$sorter.attr('id'))
|
1634
1639
|
send_sort_now.on('click', function(){
|
1635
|
-
console.log('sending sort...')
|
1636
1640
|
sorter.sendSort()
|
1637
1641
|
})
|
1638
1642
|
}
|
@@ -1677,9 +1681,7 @@ var initHooch = function(){
|
|
1677
1681
|
this.dragging = false
|
1678
1682
|
this.getDragHandle()
|
1679
1683
|
this.$sort_element.css({cursor: ''});
|
1680
|
-
this.$drag_handle.css({cursor: 'move'});
|
1681
1684
|
var sort_element = this
|
1682
|
-
this.$drag_handle.on('mousedown touchstart', $.proxy(sort_element.onMousedown, sort_element))
|
1683
1685
|
this.$sort_element.on('dragstart', function(e){hooch.pauseEvent(e); return false})
|
1684
1686
|
this.element_filters = this.getElementFilters() || {}
|
1685
1687
|
$(window).on('mousemove touchmove', function(e){
|
@@ -1707,13 +1709,13 @@ var initHooch = function(){
|
|
1707
1709
|
if(this.pressed){this.setDragging()}
|
1708
1710
|
if(this.dragging){
|
1709
1711
|
hooch.pauseEvent(e)
|
1712
|
+
this.setPosition(e)
|
1710
1713
|
var target_sorter = this.targetSorter(e)
|
1711
1714
|
if(target_sorter){
|
1712
1715
|
this.attachToSorter(target_sorter,e)
|
1713
1716
|
} else if(this.sorter){
|
1714
1717
|
this.sorter.handleDrag()
|
1715
1718
|
}
|
1716
|
-
this.setPosition(e)
|
1717
1719
|
return false
|
1718
1720
|
}
|
1719
1721
|
},
|
@@ -1729,11 +1731,14 @@ var initHooch = function(){
|
|
1729
1731
|
this.drop()
|
1730
1732
|
}
|
1731
1733
|
},
|
1734
|
+
refreshAfterPossibleMutation: function(){
|
1735
|
+
this.getDragHandle()
|
1736
|
+
},
|
1732
1737
|
currentSorters: function(){
|
1733
1738
|
var sort_element = this
|
1734
1739
|
var these_sorters = window.any_time_manager.recordedObjects['hooch.Sorter'].
|
1735
1740
|
filter(function(sorter){return sorter != sort_element.sorter}) //Don't need the current parent
|
1736
|
-
these_sorters.filter(function(sorter){return sorter.recipient_filters})
|
1741
|
+
return these_sorters.filter(function(sorter){return sorter.recipient_filters})
|
1737
1742
|
},
|
1738
1743
|
targetSorter: function(e){
|
1739
1744
|
var current_sorters = this.currentSorters()
|
@@ -1786,6 +1791,15 @@ var initHooch = function(){
|
|
1786
1791
|
if(this.$drag_handle.length < 1){
|
1787
1792
|
this.$drag_handle = this.$sort_element
|
1788
1793
|
}
|
1794
|
+
this.initializeDragHandle()
|
1795
|
+
},
|
1796
|
+
initializeDragHandle: function(){ // Starting to look like this needs its own DragHandle class?
|
1797
|
+
if(!this.$drag_handle.data('hooch.drag_handle_initialized')){
|
1798
|
+
this.$drag_handle.css({cursor: 'move'});
|
1799
|
+
var sort_element = this
|
1800
|
+
this.$drag_handle.on('mousedown touchstart', $.proxy(sort_element.onMousedown, sort_element))
|
1801
|
+
this.$drag_handle.data('hooch.drag_handle_initialized',true)
|
1802
|
+
}
|
1789
1803
|
},
|
1790
1804
|
createPlaceHolder: function(){
|
1791
1805
|
var $placeholder = this.$sort_element.
|
@@ -2018,9 +2032,9 @@ var initHooch = function(){
|
|
2018
2032
|
};
|
2019
2033
|
hooch.SortPlaceholder = hooch.SortElement.extend({
|
2020
2034
|
init: function($sort_element,sort_element){
|
2021
|
-
var new_uuid = new UUID
|
2022
2035
|
//////////////////////////////////////////
|
2023
2036
|
// Helpful for debugging in the browser
|
2037
|
+
// var new_uuid = new UUID
|
2024
2038
|
// this.uniq_id = new_uuid.value
|
2025
2039
|
//////////////////////////////////////////
|
2026
2040
|
|
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.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: 2017-11-
|
11
|
+
date: 2017-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|