     toggle_menu = -> ($ '#menu').toggle()
 
     if has_touch_events
+        forceReflow()
         ($ '.mobile-layout-inner').css('padding-top', header_height)
         ($ '#menu_button').tap((e) ->
             e.preventDefault()

        # at the position it was set to at page unload
        header_fix = -> scrollTo(0, 0)

        if gon.page is 'stores_show' or gon.page is 'products_index'
            header_fix()

            $('.product').each ->
                fetch_product_images(($ @), render_single_product_image)

window.templates = {}

window.forceReflow = (elem = document.documentElement) ->
    # http://stackoverflow.com/questions/11297641/mobile-webkit-reflow-issue/11479118#11479118
    width = elem.style.width
    px = elem.offsetWidth + 1
    elem.style.width = px+'px'

    setTimeout ->
        elem.style.width = width
        elem = null
    0

window.pluralize_like_count = (like_count) ->
    if like_count is 1 then 'like' else 'likes'

$ ->
    window.header_height =  ($ '.mobile-header').height()
