Skip to content

Commit

Permalink
fixed intentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraiz committed Mar 29, 2015
1 parent 0da7e90 commit 9e605b5
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions app/js/directives.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
angular.module('EiskaltDirectives', [])
.directive('maxHeight', function($window, $timeout) {
return {
restrict: 'A',
link: function(scope, elem, attrs) {
scope.onResize = function() {
var offset = parseInt(attrs.maxHeightOffset || 0);
angular.forEach(attrs.maxHeight.split(' '), function(className) {
angular.forEach(document.getElementsByClassName(className), function(box) {
offset += box.offsetHeight;
.directive('maxHeight', function ($window, $timeout) {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
scope.onResize = function () {
var offset = parseInt(attrs.maxHeightOffset || 0);
angular.forEach(attrs.maxHeight.split(' '), function (className) {
angular.forEach(document.getElementsByClassName(className), function (box) {
offset += box.offsetHeight;
});
});
});
elem[0].style.height = ($window.innerHeight - offset) + 'px';
}
elem[0].style.height = ($window.innerHeight - offset) + 'px';
}

$timeout(scope.onResize, 250);
$timeout(scope.onResize, 250);

angular.element($window).bind('resize', function() {
scope.onResize();
})
}
};
})
angular.element($window).bind('resize', function () {
scope.onResize();
})
}
};
})
;

0 comments on commit 9e605b5

Please sign in to comment.