Sha256: fa5ad43d4cbb631970857ab55121c7b7cb66eba40423c42adc58dabed0dac6fb
Contents?: true
Size: 1.28 KB
Versions: 26
Compression:
Stored size: 1.28 KB
Contents
/** * @ngdoc directive * @name Bastion.components.directive:bstContainerScroll * @restrict A * * @requires $window * @requires $timeout * * @description * The container scroll directive should be applied to a wrapping div around an element that * you wish to have scrolling capabilities that is outside the standard browser flow. * * @example * <pre> <div bst-container-scroll></div> </pre> */ angular.module('Bastion.components').directive('bstContainerScroll', ['$window', '$timeout', function ($window, $timeout) { return { restrict: 'A', compile: function (tElement) { tElement.addClass("container-scroll-wrapper"); return function (scope, element) { var windowElement = angular.element($window); var addScroll = function () { var windowHeight = windowElement.height(), offset = element.offset().top; element.outerHeight(windowHeight - offset); element.height(windowHeight - offset); }; windowElement.bind('resize', addScroll); $timeout(function () { windowElement.trigger('resize'); }, 0); }; } }; }]);
Version data entries
26 entries across 26 versions & 1 rubygems