Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- angular.module "myApp"
- .directive 'uibPosition',['$position','$document','$timeout', ($position,$document,$timeout)->
- return {
- restrict: 'EAC',
- link: (scope, element, attr) ->
- //I want to Trigger this event when user change windows height
- $timeout ->
- if $document.height() - $position.position(element).top < 500
- element[0].querySelector('.custom-popup-wrapper').style.top = 'auto'
- element[0].querySelector('.custom-popup-wrapper').style.bottom = 40 + 'px'
- else
- element[0].querySelector('.custom-popup-wrapper').style.top = $position.position(element).top+40+'px'
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement