var fasoon = fasoon || {}; (function (ns, $) { "use strict"; ns.QuotePriceStep2 = function () { this.construct.apply(this, arguments); }; var proto = ns.QuotePriceStep2.prototype; proto.construct = function (options) { this.options = $.extend({ form_id: undefined, phone_id: undefined, plugins_url: undefined }, options); this.form = $('#' + this.options.form_id); if (!this.form.length) { alert('Form #' + this.options.form_id + ' is not found.'); return; } this.phone = $('#' + this.options.phone_id, this.form); if (!this.phone.length) { alert('Element #' + this.options.phone_id + ' is not found.'); return; } this.form.on('submit', $.proxy(this.onFormSubmit, this)); this.phone.intlTelInput({ allowExtensions: true, autoFormat: true, autoHideDialCode: false, preferredCountries: ['de', 'ch', 'li', 'at'], initialCountry: 'de', nationalMode: false, utilsScript: this.options.plugins_url + '/js/intl-tel-input/utils.js' }); }; })(fasoon, jQuery);