|
106 | 106 | height = parseFloat(match[1]); |
107 | 107 | } |
108 | 108 | return {height: height, unit: heightUnit}; |
| 109 | + }, |
| 110 | + |
| 111 | + removePositioningStyles: function(el) { |
| 112 | + var style = el[0].style; |
| 113 | + if (style.position) style.removeProperty('position'); |
| 114 | + if (style.left) style.removeProperty('left'); |
| 115 | + if (style.top) style.removeProperty('top'); |
109 | 116 | } |
110 | 117 | }; |
111 | 118 |
|
|
869 | 876 | $(ui.helper).remove(); |
870 | 877 | node.el = el; |
871 | 878 | self.placeholder.hide(); |
| 879 | + Utils.removePositioningStyles(el); |
| 880 | + |
872 | 881 | el |
873 | 882 | .attr('data-gs-x', node.x) |
874 | 883 | .attr('data-gs-y', node.y) |
875 | 884 | .attr('data-gs-width', node.width) |
876 | 885 | .attr('data-gs-height', node.height) |
877 | 886 | .addClass(self.opts.itemClass) |
878 | | - .removeAttr('style') |
879 | 887 | .enableSelection() |
880 | 888 | .removeData('draggable') |
881 | 889 | .removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled') |
|
1170 | 1178 | } else { |
1171 | 1179 | self._clearRemovingTimeout(el); |
1172 | 1180 | if (!node._temporaryRemoved) { |
| 1181 | + Utils.removePositioningStyles(o); |
1173 | 1182 | o |
1174 | 1183 | .attr('data-gs-x', node.x) |
1175 | 1184 | .attr('data-gs-y', node.y) |
1176 | 1185 | .attr('data-gs-width', node.width) |
1177 | | - .attr('data-gs-height', node.height) |
1178 | | - .removeAttr('style'); |
| 1186 | + .attr('data-gs-height', node.height); |
1179 | 1187 | } else { |
| 1188 | + Utils.removePositioningStyles(o); |
1180 | 1189 | o |
1181 | 1190 | .attr('data-gs-x', node._beforeDragX) |
1182 | 1191 | .attr('data-gs-y', node._beforeDragY) |
1183 | 1192 | .attr('data-gs-width', node.width) |
1184 | | - .attr('data-gs-height', node.height) |
1185 | | - .removeAttr('style'); |
| 1193 | + .attr('data-gs-height', node.height); |
1186 | 1194 | node.x = node._beforeDragX; |
1187 | 1195 | node.y = node._beforeDragY; |
1188 | 1196 | self.grid.addNode(node); |
|
0 commit comments