Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. 'use strict';
  2. angular.module "myApp"
  3. .directive 'uibPosition',['$position','$document','$timeout', ($position,$document,$timeout)->
  4. return {
  5. restrict: 'EAC',
  6. link: (scope, element, attr) ->
  7. //I want to Trigger this event when user change windows height
  8. $timeout ->
  9. if $document.height() - $position.position(element).top < 500
  10. element[0].querySelector('.custom-popup-wrapper').style.top = 'auto'
  11. element[0].querySelector('.custom-popup-wrapper').style.bottom = 40 + 'px'
  12. else
  13. element[0].querySelector('.custom-popup-wrapper').style.top = $position.position(element).top+40+'px'
  14. }
  15. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement