"use strict";

class HOTEL {

    constructor($el) {
        var el;
        el = $el.get(0);
        this.el = el;
        this.init();
    }

    hotelResize() {
        
        var $lafourchette,
            lafourchetteHeight;
        
        $lafourchette = $('.lafourchette');
        if ($lafourchette.length > 0)
        {
            lafourchetteHeight = $lafourchette.height();
            if (lafourchetteHeight > 0)
            {
                $(this.el).css('height', lafourchetteHeight + 6);
            }
        }
    }

    btnPosition() {
        var hotelbtn = $('.hotel-button');
        if ($(window).width() >= 768) {
            var btn_width = hotelbtn.width();
            hotelbtn.css({'margin-left': -(btn_width / 2) - 50, 'position': 'absolute'});
        }
    }

    init() {
        var context = this;
        setTimeout(function () {
            context.hotelResize();
            context.btnPosition();
        }, 100);
        $(window).resize(function () {
            context.hotelResize();
            context.btnPosition();
        });


    }

}
export default HOTEL;