-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Tuch/bugs/issue-23
ISSUE-23
- Loading branch information
Showing
8 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Angular-DND 0.1.12 | ||
Angular-DND 0.1.13 | ||
========= | ||
|
||
Особенности: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "angular-dnd-module", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"authors": [ | ||
"Afonin A.V. <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
|
||
/** | ||
* @license AngularJS-DND v0.1.12 | ||
* @license AngularJS-DND v0.1.13 | ||
* (c) 2014-2015 Alexander Afonin ([email protected], http://github.com/Tuch) | ||
* License: MIT | ||
*/ | ||
|
@@ -19,7 +19,7 @@ | |
|
||
/* ENVIRONMENT VARIABLES */ | ||
|
||
var version = '0.1.12', | ||
var version = '0.1.13', | ||
$ = angular.element, $window = $(window), $document = $(document), body = 'body', TRANSFORM, TRANSFORMORIGIN, MATCHES_SELECTOR, | ||
debug = { | ||
mode: false, | ||
|
@@ -1218,6 +1218,9 @@ var module = angular.module('dnd', []); | |
this.dnd.trigger('drag', this.api); | ||
|
||
var axis = this.getBorderedAxis(), x = axis.x, y = axis.y, asPoint = this.asPoint; | ||
var dragenter = []; | ||
var dragover = []; | ||
var dragleave = []; | ||
|
||
for(var i = 0; i < regions.length; i++) { | ||
var region = regions[i], | ||
|
@@ -1231,15 +1234,25 @@ var module = angular.module('dnd', []); | |
if ( trigger ) { | ||
if (targetIndex === -1) { | ||
this.targets.push(region.dnd.el); | ||
region.dnd.trigger('dragenter', this.api, this.dnd.el); | ||
dragenter.push(region.dnd); | ||
} else { | ||
region.dnd.trigger('dragover', this.api, this.dnd.el); | ||
dragover.push(region.dnd); | ||
} | ||
} else if (targetIndex !== -1) { | ||
$(this.targets[targetIndex]).data('dnd')[this.dnd.layer()].trigger('dragleave', this.api, this.dnd.el); | ||
dragleave.push($(this.targets[targetIndex]).data('dnd')[this.dnd.layer()]); | ||
this.targets.splice(targetIndex, 1); | ||
} | ||
} | ||
|
||
this._triggerArray(dragleave, 'dragleave'); | ||
this._triggerArray(dragenter, 'dragenter'); | ||
this._triggerArray(dragover, 'dragover'); | ||
}, | ||
|
||
_triggerArray: function (arr, event) { | ||
for (var i = 0; i < arr.length; i++) { | ||
arr[i].trigger(event, this.api, this.dnd.el); | ||
} | ||
}, | ||
|
||
end: function (event) { | ||
|
@@ -1799,7 +1812,9 @@ function ($timeout, $parse, $http, $compile, $q, $templateCache, EventEmitter) { | |
|
||
updatePosition: function () { | ||
var position = this.api.getRelBorderedAxis(this.borderOffset).plus(this._offset); | ||
console.log(this.api.getRelBorderedAxis()) | ||
if (debug.mode) { | ||
console.log(this.api.getRelBorderedAxis()); | ||
} | ||
|
||
wrapper.dndCss(position.getAsCss()); | ||
}, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
/** | ||
* @license AngularJS-DND v0.1.12 | ||
* @license AngularJS-DND v0.1.13 | ||
* (c) 2014-2015 Alexander Afonin ([email protected], http://github.com/Tuch) | ||
* License: MIT | ||
*/ | ||
|
@@ -17,7 +17,7 @@ | |
|
||
/* ENVIRONMENT VARIABLES */ | ||
|
||
var version = '0.1.12', | ||
var version = '0.1.13', | ||
$ = angular.element, $window = $(window), $document = $(document), body = 'body', TRANSFORM, TRANSFORMORIGIN, MATCHES_SELECTOR, | ||
debug = { | ||
mode: false, | ||
|
@@ -1216,6 +1216,9 @@ var module = angular.module('dnd', []); | |
this.dnd.trigger('drag', this.api); | ||
|
||
var axis = this.getBorderedAxis(), x = axis.x, y = axis.y, asPoint = this.asPoint; | ||
var dragenter = []; | ||
var dragover = []; | ||
var dragleave = []; | ||
|
||
for(var i = 0; i < regions.length; i++) { | ||
var region = regions[i], | ||
|
@@ -1229,15 +1232,25 @@ var module = angular.module('dnd', []); | |
if ( trigger ) { | ||
if (targetIndex === -1) { | ||
this.targets.push(region.dnd.el); | ||
region.dnd.trigger('dragenter', this.api, this.dnd.el); | ||
dragenter.push(region.dnd); | ||
} else { | ||
region.dnd.trigger('dragover', this.api, this.dnd.el); | ||
dragover.push(region.dnd); | ||
} | ||
} else if (targetIndex !== -1) { | ||
$(this.targets[targetIndex]).data('dnd')[this.dnd.layer()].trigger('dragleave', this.api, this.dnd.el); | ||
dragleave.push($(this.targets[targetIndex]).data('dnd')[this.dnd.layer()]); | ||
this.targets.splice(targetIndex, 1); | ||
} | ||
} | ||
|
||
this._triggerArray(dragleave, 'dragleave'); | ||
this._triggerArray(dragenter, 'dragenter'); | ||
this._triggerArray(dragover, 'dragover'); | ||
}, | ||
|
||
_triggerArray: function (arr, event) { | ||
for (var i = 0; i < arr.length; i++) { | ||
arr[i].trigger(event, this.api, this.dnd.el); | ||
} | ||
}, | ||
|
||
end: function (event) { | ||
|