Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions multiple-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* @author Maksym Pomazan
* @version 0.0.3
*/


;;(function(){
function getSelectableElements(element) {
var out = [];
var childs = element.children();
Expand Down Expand Up @@ -112,7 +115,13 @@ angular.module('multipleSelection', [])
* @return {Object} result Transformed object
*/
function transformBox(startX, startY, endX, endY) {
var topBorder = element[0].offsetTop;
var bottomBorder = element[0].offsetHeight + topBorder;
var leftBorder = element[0].offsetLeft;
var rightBorder = element[0].offsetWidth + leftBorder;

endY = Math.min(Math.max(topBorder, endY), bottomBorder);
endX = Math.min(Math.max(leftBorder, endX), rightBorder);
var result = {};

if (startX > endX) {
Expand Down Expand Up @@ -243,3 +252,4 @@ angular.module('multipleSelection', [])
}
};
}]);
})();