passman/js/app/directives/autoscroll.js

24 lines
487 B
JavaScript
Raw Normal View History

2016-10-08 01:56:29 +08:00
(function () {
'use strict';
/**
* @ngdoc directive
* @name passmanApp.directive:autoScroll
* @description
* # autoScroll
*/
angular.module('passmanApp')
.directive('autoScroll', function () {
return {
restrict: 'A',
scope: {
autoScroll: '='
},
link: function postLink (scope, element, attrs) {
scope.$watch('autoScroll', function () {
$('#import_log').scrollTop($('#import_log')[0].scrollHeight);
}, true);
}
};
});
2016-09-25 22:18:18 +08:00
2016-10-08 01:56:29 +08:00
}());