hooch 0.15.13 → 0.15.14
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 +24 -25
- 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: 0c86e52581ab5864e003e394b4365d8141830277
|
4
|
+
data.tar.gz: 24ef5090304321742fcf6d058d015867b1ea67d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250956af0af882d5dd606c4e004adef18ab6234a6b1b546cc3b466f5ed285c1cff9c86b3b14814495ac189877ab458d18a6e6f3aff2bd692e842033281bd00fc
|
7
|
+
data.tar.gz: fa08557dee5e287806320da5535a4f841b490abeff8bf4850dfd574c663c23690fd2251af6519e1bb8a568c105cae74023c2ab12cc483aad31c1a0e9d19cee34
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Set.prototype.isSuperset = function(subset) {
|
2
|
-
|
2
|
+
var this_set = this
|
3
3
|
subset.forEach (function(elem) {
|
4
4
|
if (!this_set.has(elem)) {
|
5
5
|
return false;
|
@@ -9,8 +9,7 @@ Set.prototype.isSuperset = function(subset) {
|
|
9
9
|
}
|
10
10
|
|
11
11
|
Set.prototype.union = function(setB) {
|
12
|
-
|
13
|
-
let this_set = this
|
12
|
+
var union = Set.from_iterable(this);
|
14
13
|
setB.forEach(function(elem) {
|
15
14
|
union.add(elem);
|
16
15
|
})
|
@@ -19,7 +18,7 @@ Set.prototype.union = function(setB) {
|
|
19
18
|
|
20
19
|
Set.prototype.intersection = function(setB) {
|
21
20
|
var intersection = new Set();
|
22
|
-
|
21
|
+
var this_set = this
|
23
22
|
setB.forEach(function(elem) {
|
24
23
|
if (this_set.has(elem)) {
|
25
24
|
intersection.add(elem);
|
@@ -1105,17 +1104,17 @@ var initHooch = function(){
|
|
1105
1104
|
},
|
1106
1105
|
onMutation: function(mutations){
|
1107
1106
|
if(this.disabled) return
|
1108
|
-
|
1109
|
-
|
1107
|
+
var sorter = this;
|
1108
|
+
var actually_changed_nodes = false
|
1110
1109
|
mutations.forEach(function(mutation) {
|
1111
1110
|
if(mutation.addedNodes.length > 0){
|
1112
|
-
|
1111
|
+
var added_node = $(mutation.addedNodes[0])
|
1113
1112
|
if((!added_node.attr('id') || !added_node.attr('id').startsWith('thin_man_ajax_progress')) && !added_node.data('hooch-sorter-managed')){
|
1114
1113
|
actually_changed_nodes = true
|
1115
1114
|
}
|
1116
1115
|
}
|
1117
1116
|
if(mutation.removedNodes.length > 0){
|
1118
|
-
|
1117
|
+
var removed_node = $(mutation.removedNodes[0])
|
1119
1118
|
if((!removed_node.attr('id') || !removed_node.attr('id').startsWith('thin_man_ajax_progress')) && !removed_node.data('hooch-sorter-managed')){
|
1120
1119
|
actually_changed_nodes = true
|
1121
1120
|
}
|
@@ -1211,7 +1210,7 @@ var initHooch = function(){
|
|
1211
1210
|
this.rows = {}
|
1212
1211
|
var sorter = this
|
1213
1212
|
$.each(this.sort_elements,function(i,sort_element){
|
1214
|
-
|
1213
|
+
var this_element
|
1215
1214
|
if(sort_element != sorter.dragging_element){
|
1216
1215
|
this_element = sort_element
|
1217
1216
|
} else {
|
@@ -1440,9 +1439,9 @@ var initHooch = function(){
|
|
1440
1439
|
this.refreshGrid();
|
1441
1440
|
},
|
1442
1441
|
giveUpDraggingElement: function(){
|
1443
|
-
|
1442
|
+
var sorter = this
|
1444
1443
|
$.each(this.rows, function(row_key, row){
|
1445
|
-
|
1444
|
+
var placeholder_index = sorter.rows[row_key].indexOf(sorter.dragging_element.placeholder)
|
1446
1445
|
if(placeholder_index > -1){
|
1447
1446
|
sorter.rows[row_key].splice(placeholder_index,1)
|
1448
1447
|
}
|
@@ -1503,22 +1502,22 @@ var initHooch = function(){
|
|
1503
1502
|
})[0]
|
1504
1503
|
},
|
1505
1504
|
containsPoint: function(point){
|
1506
|
-
|
1507
|
-
|
1505
|
+
var contains_horizontal = this.left_boundary <= point.x && point.x <= this.right_boundary
|
1506
|
+
var contains_vertical = this.top_boundary <= point.y && point.y <= this.bottom_boundary
|
1508
1507
|
return contains_horizontal && contains_vertical
|
1509
1508
|
},
|
1510
1509
|
matchesFilters: function(element_filters){
|
1511
|
-
|
1510
|
+
var recipient_filters = this.$sorter.data('recipient-filters')
|
1512
1511
|
if(typeof element_filters.any == 'object'){
|
1513
1512
|
// At least one of these is required to match
|
1514
|
-
|
1513
|
+
var any = true
|
1515
1514
|
for(var key in element_filters.any){
|
1516
1515
|
if(!recipient_filters.hasOwnProperty(key)){
|
1517
1516
|
any = false
|
1518
1517
|
break
|
1519
1518
|
}
|
1520
|
-
|
1521
|
-
|
1519
|
+
var include_source = Set.from_iterable(recipient_filters[key])
|
1520
|
+
var include_test = Set.from_iterable(element_filters.any[key])
|
1522
1521
|
if(include_source.intersection(include_test).size == 0){
|
1523
1522
|
any = false
|
1524
1523
|
break
|
@@ -1527,14 +1526,14 @@ var initHooch = function(){
|
|
1527
1526
|
if(!any) return false
|
1528
1527
|
}
|
1529
1528
|
// All of these are required to match
|
1530
|
-
|
1529
|
+
var all = true
|
1531
1530
|
for(var key in element_filters.all){
|
1532
1531
|
if(!recipient_filters.hasOwnProperty(key)){
|
1533
1532
|
all = false
|
1534
1533
|
break
|
1535
1534
|
}
|
1536
|
-
|
1537
|
-
|
1535
|
+
var include_source = Set.from_iterable(recipient_filters[key])
|
1536
|
+
var include_test = Set.from_iterable(element_filters.all[key])
|
1538
1537
|
if(!include_source.isSuperset(include_test)){
|
1539
1538
|
all = false
|
1540
1539
|
break
|
@@ -1545,8 +1544,8 @@ var initHooch = function(){
|
|
1545
1544
|
var none = true
|
1546
1545
|
for(var key in element_filters.none){
|
1547
1546
|
if(!recipient_filters.hasOwnProperty(key)){continue}
|
1548
|
-
|
1549
|
-
|
1547
|
+
var exclude_source = Set.from_iterable(recipient_filters[key])
|
1548
|
+
var exclude_test = Set.from_iterable(element_filters.none[key])
|
1550
1549
|
if(exclude_source.intersection(exclude_test).size != 0){
|
1551
1550
|
none = false
|
1552
1551
|
break
|
@@ -1590,8 +1589,8 @@ var initHooch = function(){
|
|
1590
1589
|
}
|
1591
1590
|
},
|
1592
1591
|
getSendSort: function(){
|
1593
|
-
|
1594
|
-
|
1592
|
+
var send_sort_now = this.$sorter.find('[data-send-sort-now]')
|
1593
|
+
var sorter = this
|
1595
1594
|
if(send_sort_now.length > 0){
|
1596
1595
|
console.log('got send sort:')
|
1597
1596
|
console.log(this.$sorter.attr('id'))
|
@@ -1788,7 +1787,7 @@ var initHooch = function(){
|
|
1788
1787
|
return this.$sort_element.data('target-filters')
|
1789
1788
|
},
|
1790
1789
|
getOffset: function(){
|
1791
|
-
|
1790
|
+
var viewport_offset = this.$sort_element[0].getBoundingClientRect()
|
1792
1791
|
return {top: viewport_offset.top + window.pageYOffset,
|
1793
1792
|
left: viewport_offset.left + window.pageXOffset,
|
1794
1793
|
height: viewport_offset.height,
|
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.14
|
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-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|