examples.map.builder.js 616 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. (function( $ ) {
  2. 'use strict';
  3. var $window = $(window);
  4. /* Fix Map size on Mobile */
  5. function fixMapListener() {
  6. fixMapSize();
  7. $(window).on('load resize orientationchange', function() {
  8. fixMapSize();
  9. });
  10. }
  11. function fixMapSize() {
  12. if ( $window.width() <= 767 ) {
  13. var windowHeight = $(window).height(),
  14. offsetTop = $('#gmap').offset().top,
  15. contentPadding = parseInt($('.content-body').css('padding-bottom'), 10);
  16. $('#gmap').height( windowHeight - offsetTop - contentPadding );
  17. }
  18. }
  19. // auto initialize
  20. $(function() {
  21. fixMapListener();
  22. });
  23. }).apply(this, [ jQuery ]);