Skip to content

Commit

Permalink
Add jquery.scrollintoview
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Azimi committed Oct 13, 2014
1 parent 84fbfc7 commit b1b6c06
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"excludeFiles": [
"app/scripts/enums/swagger-json-schema.js",
"app/scripts/analytics/google.js"
"app/scripts/analytics/google.js",
"app/scripts/plugins/*.js"
],
"requireCurlyBraces": [
"if",
Expand Down
3 changes: 2 additions & 1 deletion .jshintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
app/scripts/analytics/google.js
app/scripts/enums/swagger-json-schema.js
app/scripts/enums/defaults.js
app/scripts/enums/defaults.js
app/scripts/plugins/*
19 changes: 19 additions & 0 deletions app/scripts/directives/scroll-into-view-when.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

PhonicsApp.directive('scrollIntoViewWhen', function () {
// var TRANSITION_DURATION = 200; //ms

return {
restrict: 'A',
link: function postLink($scope, $element, $attrs) {

$scope.$watch($attrs.scrollIntoViewWhen, function (val) {
if (val) {
$('.preview.pane').animate({
scrollTop: $element
}, 1000);
}
});
}
};
});

0 comments on commit b1b6c06

Please sign in to comment.