Created
October 18, 2016 19:16
-
-
Save JiLiZART/d720a440a7b6139ae17ab738dce39e3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @module input_type_tel | |
*/ | |
modules.define( | |
'input', | |
['i-bem__dom', 'jquery'], | |
function (provide, BEMDOM, jQuery, Input) { | |
/* borschik:include:../../libs/intl-tel-input/build/js/intlTelInput.js */ | |
/** | |
* @exports | |
* @class input_type_tel | |
* @bem | |
* | |
*/ | |
provide(Input.decl({modName: 'type', modVal: 'tel'}, /** @lends input_type_tel.prototype */{ | |
getDefaultParams: function () { | |
var params = this.__base.apply(this, arguments); | |
return jQuery.extend({}, params, { | |
options: { | |
preferredCountries: ['us', 'gb', 'ru', 'fr', 'sp', 'tr', 'de', 'cn', 'pt', 'jp', 'ae'], | |
nationalMode: false, | |
autoHideDialCode: true, | |
autoPlaceholder: true | |
} | |
}); | |
}, | |
onSetMod: { | |
'js': { | |
'inited': function () { | |
this.__base.apply(this, arguments); | |
this.elem('control').intlTelInput(this.params.options); | |
} | |
} | |
} | |
}, {})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment