Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Commit

Permalink
Tuch#41 Fixed scrolling breakes resizable element (Dirty!)
Browse files Browse the repository at this point in the history
  • Loading branch information
artar94 committed Jan 11, 2017
1 parent 9143698 commit 868db1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
14 changes: 11 additions & 3 deletions dist/angular-dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,17 @@ extend($.prototype, {
var ret, position, parents = this.dndClosest();
var self = this[0];

var selfIndex = parents.index(self);
if (selfIndex >= 0) {
if ($(self).hasClass("angular-dnd-resizable-handle")) {
selfIndex++;
}
parents.splice(0, selfIndex + 1);
}

var parentExists = false;
forEach(parents, function(element) {
if (!parentExists && element !== self) {
if (!parentExists) {
position = $(element).dndCss('position');

if (position === 'absolute' || position === 'relative' || position === 'fixed') {
Expand Down Expand Up @@ -2233,7 +2241,7 @@ module.directive('dndResizable', ['$parse', '$timeout', function($parse, $timeou
local.inverseRotateMatrix = local.rotateMatrix.inverse();
local.parentRect = local.$parent.dndClientRect();

var axis = api.getBorderedAxis(), crect = $el.dndClientRect(), srect = local.rect = $el.dndStyleRect();
var axis = api.getRelBorderedAxis(), crect = $el.dndClientRect(), srect = local.rect = $el.dndStyleRect();

local.borders = api.getBorders();
local.startAxis = axis;
Expand All @@ -2260,7 +2268,7 @@ module.directive('dndResizable', ['$parse', '$timeout', function($parse, $timeou

if (!local.started) return;

var axis = api.getBorderedAxis();
var axis = api.getRelBorderedAxis();
var vector = Point(axis).minus(local.startAxis).transform(local.inverseRotateMatrix);

var scale = {x:1,y:1};
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-dnd.min.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/core.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,17 @@ extend($.prototype, {
var ret, position, parents = this.dndClosest();
var self = this[0];

var selfIndex = parents.index(self);
if (selfIndex >= 0) {
if ($(self).hasClass("angular-dnd-resizable-handle")) {
selfIndex++;
}
parents.splice(0, selfIndex + 1);
}

var parentExists = false;
forEach(parents, function(element) {
if (!parentExists && element !== self) {
if (!parentExists) {
position = $(element).dndCss('position');

if (position === 'absolute' || position === 'relative' || position === 'fixed') {
Expand Down
4 changes: 2 additions & 2 deletions src/directives/dndResizable.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.directive('dndResizable', ['$parse', '$timeout', function($parse, $timeou
local.inverseRotateMatrix = local.rotateMatrix.inverse();
local.parentRect = local.$parent.dndClientRect();

var axis = api.getBorderedAxis(), crect = $el.dndClientRect(), srect = local.rect = $el.dndStyleRect();
var axis = api.getRelBorderedAxis(), crect = $el.dndClientRect(), srect = local.rect = $el.dndStyleRect();

local.borders = api.getBorders();
local.startAxis = axis;
Expand All @@ -79,7 +79,7 @@ module.directive('dndResizable', ['$parse', '$timeout', function($parse, $timeou

if (!local.started) return;

var axis = api.getBorderedAxis();
var axis = api.getRelBorderedAxis();
var vector = Point(axis).minus(local.startAxis).transform(local.inverseRotateMatrix);

var scale = {x:1,y:1};
Expand Down

0 comments on commit 868db1c

Please sign in to comment.