Skip to content

Commit 0a53a93

Browse files
wip
1 parent be532ea commit 0a53a93

File tree

4 files changed

+83
-19
lines changed

4 files changed

+83
-19
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
bower_components/

bower.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "angular-scroll-pane",
3+
"version": "0.0.0",
4+
"homepage": "https://github.com/lght/angular-scroll-pane",
5+
"authors": [
6+
"Geoffrey Bauduin <[email protected]>"
7+
],
8+
"description": "AngularJS bindings for jScrollPane",
9+
"main": "dist/angular-scroll-pane.min.js",
10+
"moduleType": [
11+
"node"
12+
],
13+
"keywords": [
14+
"angularjs",
15+
"angular",
16+
"jscrollpane",
17+
"scroll",
18+
"pane"
19+
],
20+
"license": "MIT",
21+
"ignore": [
22+
"**/.*",
23+
"node_modules",
24+
"bower_components",
25+
"test",
26+
"tests"
27+
],
28+
"dependencies": {
29+
"jquery": "~2.1.1",
30+
"angularjs": "~1.2.23",
31+
"jscrollpane": "~2.0.14"
32+
}
33+
}

jscrollpane.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
angular
2-
.module('app')
3-
.directive('scrollPane', function () {
4-
5-
return {
6-
restrict: 'A',
7-
transclude: true,
8-
template: '<div class="scroll-pane"><div ng-transclude></div></div>',
9-
link: function (scope, elem, $attrs) {
10-
var config = {};
11-
if ($attrs.scrollConfig) {
12-
config = scope.$eval($attrs.scrollConfig);
13-
}
14-
jQuery(function () {
15-
jQuery(".scroll-pane").jScrollPane(config);
16-
});
17-
},
18-
replace: true
1+
angular.module("ngJScrollPane", []);
2+
angular.module("ngJScrollPane").directive("scrollPane", function () {
3+
return {
4+
restrict: 'A',
5+
transclude: true,
6+
template: '<div class="scroll-pane" ng-class="class" ng-id="id"><div ng-transclude></div></div>',
7+
scope: {
8+
class: "@",
9+
id: "@"
1910
}
11+
link: function (scope, elem, $attrs) {
12+
var config = {};
13+
if ($attrs.scrollConfig) {
14+
config = scope.$eval($attrs.scrollConfig);
15+
}
16+
jQuery(function () {
17+
jQuery("#" + scope.id).jScrollPane(config);
18+
});
19+
},
20+
replace: true
21+
}
2022

21-
});
23+
});

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "angular-scroll-pane",
3+
"version": "0.0.0",
4+
"description": "AngularJS bindings for jScrollPane",
5+
"main": "jscrollpane.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git://github.com/lght/angular-scroll-pane"
12+
},
13+
"keywords": [
14+
"angularjs",
15+
"jscrollpane",
16+
"scroll",
17+
"pane"
18+
],
19+
"author": "Geoffrey Bauduin <[email protected]>",
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/lght/angular-scroll-pane/issues"
23+
},
24+
"devDependencies": {
25+
"bower": "~1.3.9"
26+
}
27+
}

0 commit comments

Comments
 (0)