define([
    'jquery',
    'jquery/ui',
    'Magento_Ui/js/modal/modal'
], function ($) {
    'use strict';

    $.widget('filoblu.storelocator_modal', {

        _create: function () {

            var self = this,
                popup = self.element,
                trigger = self.options.trigger;


            popup.modal(
              {
                modalClass: 'storelocator-wrapper-popup-container'
              }
            );

            $(trigger).on('click', function(e){
                popup.modal('openModal');
            })
        }


    });

    return $.filoblu.storelocator_modal;
});
