app/assets/javascripts/hooch.js in hooch-0.6.0 vs app/assets/javascripts/hooch.js in hooch-0.6.1
- old
+ new
@@ -603,11 +603,11 @@
sorter.onMousemove(e)
})
var observer = new MutationObserver(function(mutations) {
sorter.handleMutations(mutations)
});
- var config = { childList: true };
+ var config = { childList: true, subtree: true };
observer.observe($sorter[0], config);
},
onMousemove: function(e){
if(this.dragging_element){
this.handleMouseMove(e)
@@ -644,17 +644,17 @@
handleMutations: function(mutations){
var sorter = this;
mutations.forEach(function(mutation) {
if(mutation.addedNodes.length > 0){
var added_node = $(mutation.addedNodes[0])
- if((added_node.attr('id') && !added_node.attr('id').startsWith('thin_man_ajax_progress')) && !added_node.data('hooch-sorter-managed')){
+ if((!added_node.attr('id') || !added_node.attr('id').startsWith('thin_man_ajax_progress')) && !added_node.data('hooch-sorter-managed')){
sorter.getSortElements()
}
}
if(mutation.removedNodes.length > 0){
var removed_node = $(mutation.removedNodes[0])
- if((removed_node.attr('id') && !removed_node.attr('id').startsWith('thin_man_ajax_progress')) && !removed_node.data('hooch-sorter-managed')){
+ if((!removed_node.attr('id') || !removed_node.attr('id').startsWith('thin_man_ajax_progress')) && !removed_node.data('hooch-sorter-managed')){
sorter.getSortElements()
}
}
});
},
@@ -698,11 +698,11 @@
if(!sorter.rows[elem_top]){
sorter.rows[elem_top] = []
}
sorter.rows[elem_top].push(this_element)
})
- this.row_keys = Object.keys(this.rows).map(function(val,i){return parseInt(val)}).sort(sorter.numberSort)
+ this.row_keys = Object.keys(this.rows).map(function(val,i){return parseFloat(val)}).sort(sorter.numberSort)
$.each(this.rows, function(row_key,row){row.sort(sorter.elementHorizontalSort)})
},
redrawDraggingElement: function(e){
this.dragging_element.setPosition(e);
},
@@ -964,9 +964,10 @@
this.width = this.$sort_element.width()
this.height = this.$sort_element.height()
}
this.dragging = false
this.getDragHandle()
+ this.$sort_element.css({cursor: ''});
this.$drag_handle.css({cursor: 'move'});
var sort_element = this
this.$drag_handle.on('mousedown', $.proxy(sort_element.onMousedown, sort_element))
this.$sort_element.on('dragstart', function(e){hooch.pauseEvent(e); return false})
},