hooch 0.15.16 → 0.15.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d39f9cb653059ca6041eaeee003f87306253630c
4
- data.tar.gz: 2f1014ebe3d7328b374175affe5b76dc8ba89781
3
+ metadata.gz: 6f9e1a2069e3af9fcaa50e8499403980a6bf6e6c
4
+ data.tar.gz: b002417fd825a53c126a23d91f15406fc0de9a57
5
5
  SHA512:
6
- metadata.gz: b6c6d8c665d7ba52cd2ce8277726ba9bf890b20ec91f3a41c3d855c3ac232c14eff18b29fcc626903eb58792735a9af813c40dacc8d7a80edbe088c6967f4837
7
- data.tar.gz: 5b6321eede6a7b603ee6c4e67e29d7a73c9386bf151409b58dc728c1037fd29c785c387fbc19c689f9c9ef53fb6a5d7785f8bcfdfc2f917cab15a9c0ec5eef7d
6
+ metadata.gz: 5cbf71d663e7a7e5f40fce2ec8bde9295088646dc361451558ab100d8eda2627e6b51b08851209cc28acd1ba4b65eeb5f41fcfc2873c390b0e48d6c18e12cbd8
7
+ data.tar.gz: 71239cfb4182e1fbcb67f6ec6fb623fea7137982ee806ddcc315faec4afb48140cfbe8c88ea20b8379b315318957c07937b1589026876b776f215bf3a81b2d46
@@ -1082,6 +1082,7 @@ var initHooch = function(){
1082
1082
  this.getSortElements()
1083
1083
  }
1084
1084
  this.getSendSort()
1085
+ this.getRecipientFilters()
1085
1086
  this.startInactivityRefresh()
1086
1087
  var sorter = this
1087
1088
  $(window).on('mouseup touchend touchcancel', function(e){
@@ -1537,17 +1538,22 @@ var initHooch = function(){
1537
1538
  var contains_vertical = this.top_boundary <= point.y && point.y <= this.bottom_boundary
1538
1539
  return contains_horizontal && contains_vertical
1539
1540
  },
1541
+ getRecipientFilters: function(){
1542
+ this.recipient_filters = this.$sorter.data('recipient-filters')
1543
+ },
1540
1544
  matchesFilters: function(element_filters){
1541
- var recipient_filters = this.$sorter.data('recipient-filters')
1545
+ if(!this.recipient_filters){
1546
+ return false
1547
+ }
1542
1548
  if(typeof element_filters.any == 'object'){
1543
1549
  // At least one of these is required to match
1544
1550
  var any = true
1545
1551
  for(var key in element_filters.any){
1546
- if(!recipient_filters.hasOwnProperty(key)){
1552
+ if(!this.recipient_filters.hasOwnProperty(key)){
1547
1553
  any = false
1548
1554
  break
1549
1555
  }
1550
- var include_source = Set.from_iterable(recipient_filters[key])
1556
+ var include_source = Set.from_iterable(this.recipient_filters[key])
1551
1557
  var include_test = Set.from_iterable(element_filters.any[key])
1552
1558
  if(include_source.intersection(include_test).size == 0){
1553
1559
  any = false
@@ -1559,11 +1565,11 @@ var initHooch = function(){
1559
1565
  // All of these are required to match
1560
1566
  var all = true
1561
1567
  for(var key in element_filters.all){
1562
- if(!recipient_filters.hasOwnProperty(key)){
1568
+ if(!this.recipient_filters.hasOwnProperty(key)){
1563
1569
  all = false
1564
1570
  break
1565
1571
  }
1566
- var include_source = Set.from_iterable(recipient_filters[key])
1572
+ var include_source = Set.from_iterable(this.recipient_filters[key])
1567
1573
  var include_test = Set.from_iterable(element_filters.all[key])
1568
1574
  if(!include_source.isSuperset(include_test)){
1569
1575
  all = false
@@ -1574,8 +1580,8 @@ var initHooch = function(){
1574
1580
  // None of these can be present to match
1575
1581
  var none = true
1576
1582
  for(var key in element_filters.none){
1577
- if(!recipient_filters.hasOwnProperty(key)){continue}
1578
- var exclude_source = Set.from_iterable(recipient_filters[key])
1583
+ if(!this.recipient_filters.hasOwnProperty(key)){continue}
1584
+ var exclude_source = Set.from_iterable(this.recipient_filters[key])
1579
1585
  var exclude_test = Set.from_iterable(element_filters.none[key])
1580
1586
  if(exclude_source.intersection(exclude_test).size != 0){
1581
1587
  none = false
@@ -1698,9 +1704,9 @@ var initHooch = function(){
1698
1704
  },
1699
1705
  onMousemove: function(e){
1700
1706
  if(this.disabled) return
1701
- hooch.pauseEvent(e)
1702
1707
  if(this.pressed){this.setDragging()}
1703
1708
  if(this.dragging){
1709
+ hooch.pauseEvent(e)
1704
1710
  var target_sorter = this.targetSorter(e)
1705
1711
  if(target_sorter){
1706
1712
  this.attachToSorter(target_sorter,e)
@@ -1708,8 +1714,8 @@ var initHooch = function(){
1708
1714
  this.sorter.handleDrag()
1709
1715
  }
1710
1716
  this.setPosition(e)
1717
+ return false
1711
1718
  }
1712
- return false
1713
1719
  },
1714
1720
  onMouseup: function(e){
1715
1721
  if(this.disabled) return
@@ -1725,8 +1731,9 @@ var initHooch = function(){
1725
1731
  },
1726
1732
  currentSorters: function(){
1727
1733
  var sort_element = this
1728
- return window.any_time_manager.recordedObjects['hooch.Sorter'].
1734
+ var these_sorters = window.any_time_manager.recordedObjects['hooch.Sorter'].
1729
1735
  filter(function(sorter){return sorter != sort_element.sorter}) //Don't need the current parent
1736
+ these_sorters.filter(function(sorter){return sorter.recipient_filters})
1730
1737
  },
1731
1738
  targetSorter: function(e){
1732
1739
  var current_sorters = this.currentSorters()
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.15.16"
2
+ VERSION = "0.15.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.16
4
+ version: 0.15.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut