index.js 397 B

123456789101112131415161718
  1. /**
  2. *
  3. *
  4. * Modal position fix.
  5. * add custom class if modal height is bigger than window.
  6. */
  7. mgEventHandler.on('ModalLoaded', null,function(){
  8. $('.lu-modal__dialog').each(function(index){
  9. var self = $(this);
  10. var pixelDiff = $(window).height() - self.height();
  11. if(pixelDiff < 30)
  12. {
  13. self.addClass('lu-modal_fixed_position');
  14. }
  15. });
  16. });