hooch 0.8.4 → 0.8.5

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: db5d493babba7149e90d31632dff658637efe604
4
- data.tar.gz: 7946e936f9512365ec756c05f6bf96304f427a83
3
+ metadata.gz: d82d0a2abc9ab709e76636753bc6d8e9b3cb8167
4
+ data.tar.gz: 63f04970f34080828d230bafd0eca1188eea8c7a
5
5
  SHA512:
6
- metadata.gz: d6e4b29ff2e8c3f77fc3bbed21088fb31b0c3a52ed994adf2820510a3c81fd4fb03b20457fe04b5d2030bd6a1ca3dbc781a8fc9eb4603c7f6933f003aa3b97e2
7
- data.tar.gz: a3b2aaf87e4b50309a7bb3301823a8dae6be0b8eff1d62ed3a4c543da39ac8f244e740c650e40543c316b30c3037c2b944fcc05e6fe3cfac0bf1802ef0e2c57d
6
+ metadata.gz: 9129a6c7455cc45863d678d4e0136f6ad93c2f5f83d560c4a5db27252bf85d0df0b2e91c8814ae917b78be08126786c85403898352614928d3713ac1c54ab251
7
+ data.tar.gz: 7fe0002df9d97f2e13cfb919a6fd5b25012d05e40b551b4c108321e1e9f70d68b24d51c31eea5b096259953139348525cbfbdad84c6cf502ab8284d5a119dfe3
@@ -626,8 +626,11 @@ var initHooch = function(){
626
626
  init: function($sorter){
627
627
  this.$sorter = $sorter
628
628
  $sorter.data('sorter',this)
629
- this.width = $sorter.width()
630
- this.getSortElements()
629
+ this.is_visible = $sorter.is(':visible')
630
+ if(this.is_visible){
631
+ this.setWidth();
632
+ this.getSortElements()
633
+ }
631
634
  var sorter = this
632
635
  $(window).on('mouseup', function(e){
633
636
  sorter.onMouseup();
@@ -638,7 +641,7 @@ var initHooch = function(){
638
641
  var observer = new MutationObserver(function(mutations) {
639
642
  sorter.handleMutations(mutations)
640
643
  });
641
- var config = { childList: true, subtree: true };
644
+ var config = { childList: true, subtree: true, attributes: true };
642
645
  observer.observe($sorter[0], config);
643
646
  },
644
647
  onMousemove: function(e){
@@ -673,6 +676,19 @@ var initHooch = function(){
673
676
  if(pressed_element){
674
677
  pressed_element.unSetPressed()
675
678
  }
679
+ var sorter = this
680
+ setTimeout(function(){
681
+ if(!sorter.is_visible){
682
+ if(sorter.$sorter.is(':visible')){
683
+ sorter.setWidth();
684
+ sorter.getSortElements();
685
+ }
686
+ }
687
+ },1000)
688
+ },
689
+ setWidth: function(){
690
+ this.width = this.$sorter.width()
691
+ this.$sorter.css({width: this.width})
676
692
  },
677
693
  handleMutations: function(mutations){
678
694
  var sorter = this;
@@ -692,9 +708,11 @@ var initHooch = function(){
692
708
  });
693
709
  },
694
710
  getPressedElement: function(){
695
- var possible_pressed_element = $.grep(this.sort_elements, function(sort_element,i){return sort_element.pressed})
696
- if(possible_pressed_element.length > 0){
697
- return possible_pressed_element[0]
711
+ if(this.sort_elements){
712
+ var possible_pressed_element = $.grep(this.sort_elements, function(sort_element,i){return sort_element.pressed})
713
+ if(possible_pressed_element.length > 0){
714
+ return possible_pressed_element[0]
715
+ }
698
716
  }
699
717
  return false
700
718
  },
@@ -989,10 +1007,11 @@ var initHooch = function(){
989
1007
  this.sorter = sorter;
990
1008
  this.$sort_element = $sort_element;
991
1009
  this.old_position = $sort_element.css('position')
992
- this.starting_width = this.$sort_element[0].style.height
993
- this.starting_height = this.$sort_element[0].style.width
1010
+ this.starting_width = this.$sort_element[0].style.width
1011
+ this.starting_height = this.$sort_element[0].style.height
994
1012
  this.starting_top = this.$sort_element[0].style.top
995
1013
  this.starting_left = this.$sort_element[0].style.left
1014
+ $sort_element.css({width: this.starting_width})
996
1015
  if(typeof(window.getComputedStyle) == 'function'){
997
1016
  var computed_style = window.getComputedStyle(this.$sort_element[0])
998
1017
  this.width = parseInt(computed_style.width)
data/lib/hooch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.5"
3
3
  end
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.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-18 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails