Skip to content

Commit

Permalink
Cleanup and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jellekralt committed Aug 11, 2016
1 parent eb32d09 commit 607b0a8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
.idea/
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "angular-drag-scroll",
"version": "0.1.1",
"homepage": "https://github.com/jellekralt/angular-drag-scroll",
"authors": [
"Jelle Kralt <[email protected]>"
Expand Down
1 change: 1 addition & 0 deletions dist/ng-drag-scroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-drag-scroll",
"version": "0.1.1",
"version": "0.2.0",
"description": "Lightweight drag to scroll directive for AngularJS",
"dependencies": {},
"devDependencies": {
Expand Down
17 changes: 7 additions & 10 deletions src/ng-drag-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
var onDragStart = $parse($attributes.onDragStart);
var onDragEnd = $parse($attributes.onDragEnd);
var axis = $attributes.axis || false;
if($attributes.dragScrollExcludedClasses){
var excludedClasses = $attributes.dragScrollExcludedClasses.split(',') || false;
} else {
var excludedClasses = false;
}
var excludedClasses = $attributes.dragScrollExcludedClasses ? $attributes.dragScrollExcludedClasses.split(',') : [];
var startClientX;
var startClientY;
var lastClientX;
Expand Down Expand Up @@ -83,7 +79,7 @@
e.preventDefault();
e.stopPropagation();
}

}

/**
Expand Down Expand Up @@ -111,7 +107,7 @@

removeDragListeners();
}

}

/**
Expand All @@ -130,7 +126,7 @@
}

e.preventDefault();
}
}
}

/**
Expand All @@ -147,12 +143,13 @@
* @param {object} element Selected element
*/
function selectText (element) {
var range;
if ($window.document.selection) {
var range = $window.document.body.createTextRange();
range = $window.document.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if ($window.getSelection) {
var range = $window.document.createRange();
range = $window.document.createRange();
range.selectNode(element);
$window.getSelection().addRange(range);
}
Expand Down

0 comments on commit 607b0a8

Please sign in to comment.