|
107 | 107 | }else{ |
108 | 108 | _.each(collision_nodes,function(collision_node){ |
109 | 109 | self.move_node(collision_node, collision_node.x , node.y + node.height, |
110 | | - collision_node.width, collision_node.height, true); |
| 110 | + collision_node.width, collision_node.height, true); |
111 | 111 | }); |
112 | 112 | } |
113 | 113 | }; |
|
682 | 682 | return; |
683 | 683 | } |
684 | 684 | self.grid.move_node(node, x, y); |
685 | | - self._update_container_height(); |
| 685 | + self._update_container_height(); |
686 | 686 | } |
687 | 687 |
|
688 | 688 | }, |
|
723 | 723 | } |
724 | 724 | }; |
725 | 725 |
|
726 | | - GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) { |
| 726 | + GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position, attach_node) { |
727 | 727 | el = $(el); |
728 | 728 | if (typeof x != 'undefined') el.attr('data-gs-x', x); |
729 | 729 | if (typeof y != 'undefined') el.attr('data-gs-y', y); |
730 | 730 | if (typeof width != 'undefined') el.attr('data-gs-width', width); |
731 | 731 | if (typeof height != 'undefined') el.attr('data-gs-height', height); |
732 | 732 | if (typeof auto_position != 'undefined') el.attr('data-gs-auto-position', auto_position ? 'yes' : null); |
733 | | - this.container.append(el); |
| 733 | + if(attach_node) { |
| 734 | + this.container.append(el); |
| 735 | + } |
734 | 736 | this._prepare_element(el); |
735 | 737 | this._update_container_height(); |
736 | 738 | this._trigger_change_event(true); |
|
0 commit comments