hooch 0.8.4 → 0.8.5
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 +27 -8
- 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: d82d0a2abc9ab709e76636753bc6d8e9b3cb8167
|
4
|
+
data.tar.gz: 63f04970f34080828d230bafd0eca1188eea8c7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
630
|
-
this.
|
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
|
-
|
696
|
-
|
697
|
-
|
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.
|
993
|
-
this.starting_height = this.$sort_element[0].style.
|
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
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
|
+
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-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|