Skip to content

Commit

Permalink
Update ngDraggable.js
Browse files Browse the repository at this point in the history
I am using Boostrap  framwork to set my Modules.
Modul width is set to 100% to adapt to columns.
While dragging, module is set to "fixed position" and its width is changing to 100%.

I also add width while dragging to prevent from fixed position.
After dradding, i set back initial width.
  • Loading branch information
jtrotoux committed Feb 23, 2015
1 parent 64685f3 commit b5bc602
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ angular.module("ngDraggable", [])
if(! _dragEnabled)return;
evt.preventDefault();
element.addClass('dragging');
element.width(element.width()); // prevent from fixed position
offset = ngDraggable.getPrivOffset(element);
_dragOffset = offset;

Expand Down Expand Up @@ -176,6 +177,7 @@ angular.module("ngDraggable", [])
evt.preventDefault();
$rootScope.$broadcast('draggable:end', {x:_mx, y:_my, tx:_tx, ty:_ty, event:evt, element:element, data:_data, callback:onDragComplete, uid: _myid});
element.removeClass('dragging');
element.css("width","initial"); // prevent from fixed position
reset();
$document.off(_moveEvents, onmove);
$document.off(_releaseEvents, onrelease);
Expand Down

0 comments on commit b5bc602

Please sign in to comment.