Skip to content

Commit 464e194

Browse files
committed
1.8.2
1 parent 1f798d8 commit 464e194

27 files changed

+47
-37
lines changed

bfh-country.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"country"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-currency.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"currency"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-datepicker.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"datepicker"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-font.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"font"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-fontsize.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"fontsize"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-googlefont.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"googlefont"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-language.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"language"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-phone.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"phone"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-select.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"select"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-state.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"state"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-timepicker.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"timepicker"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

bfh-timezone.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"input",
88
"timezone"
99
],
10-
"version": "1.8.1",
10+
"version": "1.8.2",
1111
"author": {
1212
"name": "Vincent Lamanna",
1313
"url": "http://vincentlamanna.com"

docs/assets/js/bootstrap-formhelpers-phone.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
this.options = $.extend({}, $.fn.bfhphone.defaults, options)
3030
this.$element = $(element)
3131
if (this.$element.is('input[type="text"]') || this.$element.is('input[type="tel"]')) {
32-
this.$element.on('propertychange.bfhphone.data-api change.bfhphone.data-api input.bfhphone.data-api keyup.bfhphone.data-api paste.bfhphone.data-api', {phoneObject: this}, this.change)
33-
3432
var country = this.options.country
3533

3634
var formObject = this.$element.closest('form')
@@ -40,7 +38,6 @@
4038

4139
if (countryObject.length != 0) {
4240
this.options.format = BFHPhoneFormatList[countryObject.val()]
43-
countryObject.on('change.bfhphone.data-api', {phoneObject: this}, this.changeCountry)
4441
} else {
4542
this.options.format = BFHPhoneFormatList[country]
4643
}
@@ -100,7 +97,9 @@
10097
, addFormatter: function () {
10198
var formattedNumber = this.getFormattedNumber()
10299

100+
this.$element.addClass('disabled');
103101
this.$element.val(formattedNumber)
102+
this.$element.removeClass('disabled');
104103
}
105104

106105
, displayFormatter: function () {
@@ -111,7 +110,7 @@
111110

112111
, changeCountry: function (e) {
113112
var $this = $(this)
114-
var phoneObject = e.data.phoneObject
113+
var phoneObject = $(this).data('bfhphone')
115114

116115
phoneObject.options.format = BFHPhoneFormatList[$this.val()]
117116

@@ -121,9 +120,9 @@
121120
, change: function(e) {
122121
var $this
123122

124-
$this = e.data.phoneObject
123+
$this = $(this).data('bfhphone')
125124

126-
if ($this.$element.is('.disabled, :disabled')) return
125+
if ($this.$element.is('.disabled, :disabled')) return false
127126

128127
var number = $this.$element.val()
129128
var newNumber = ""
@@ -177,5 +176,11 @@
177176
$phone.bfhphone($phone.data())
178177
})
179178
})
179+
180+
$(function () {
181+
$('body')
182+
.on('propertychange.bfhphone.data-api change.bfhphone.data-api input.bfhphone.data-api keyup.bfhphone.data-api paste.bfhphone.data-api', '.bfh-phone', BFHPhone.prototype.change)
183+
.on('change.bfhphone.data-api', '.bfh-country', BFHPhone.prototype.changeCountry)
184+
})
180185

181186
}(window.jQuery);

docs/country.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/currency.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/datepicker.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/font.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/fontsize.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/googlefont.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/language.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/phone.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/select.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/state.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/timepicker.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

docs/timezone.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Bootstrap Form Helpers</h1>
6363
<p><a href="https://github.com/vlamanna/BootstrapFormHelpers/zipball/master" class="btn btn-primary btn-large">Download Bootstrap Form Helpers</a></p>
6464
<ul class="masthead-links">
6565
<li><a href="http://github.com/vlamanna/BootstrapFormHelpers">GitHub project</a></li>
66-
<li>Version 1.8.1</li>
66+
<li>Version 1.8.2</li>
6767
</ul>
6868
</div>
6969
</div>

js/bootstrap-formhelpers-phone.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
this.options = $.extend({}, $.fn.bfhphone.defaults, options)
3030
this.$element = $(element)
3131
if (this.$element.is('input[type="text"]') || this.$element.is('input[type="tel"]')) {
32-
this.$element.on('propertychange.bfhphone.data-api change.bfhphone.data-api input.bfhphone.data-api keyup.bfhphone.data-api paste.bfhphone.data-api', {phoneObject: this}, this.change)
33-
3432
var country = this.options.country
3533

3634
var formObject = this.$element.closest('form')
@@ -40,7 +38,6 @@
4038

4139
if (countryObject.length != 0) {
4240
this.options.format = BFHPhoneFormatList[countryObject.val()]
43-
countryObject.on('change.bfhphone.data-api', {phoneObject: this}, this.changeCountry)
4441
} else {
4542
this.options.format = BFHPhoneFormatList[country]
4643
}
@@ -100,7 +97,9 @@
10097
, addFormatter: function () {
10198
var formattedNumber = this.getFormattedNumber()
10299

100+
this.$element.addClass('disabled');
103101
this.$element.val(formattedNumber)
102+
this.$element.removeClass('disabled');
104103
}
105104

106105
, displayFormatter: function () {
@@ -111,7 +110,7 @@
111110

112111
, changeCountry: function (e) {
113112
var $this = $(this)
114-
var phoneObject = e.data.phoneObject
113+
var phoneObject = $(this).data('bfhphone')
115114

116115
phoneObject.options.format = BFHPhoneFormatList[$this.val()]
117116

@@ -121,9 +120,9 @@
121120
, change: function(e) {
122121
var $this
123122

124-
$this = e.data.phoneObject
123+
$this = $(this).data('bfhphone')
125124

126-
if ($this.$element.is('.disabled, :disabled')) return
125+
if ($this.$element.is('.disabled, :disabled')) return false
127126

128127
var number = $this.$element.val()
129128
var newNumber = ""
@@ -177,5 +176,11 @@
177176
$phone.bfhphone($phone.data())
178177
})
179178
})
179+
180+
$(function () {
181+
$('body')
182+
.on('propertychange.bfhphone.data-api change.bfhphone.data-api input.bfhphone.data-api keyup.bfhphone.data-api paste.bfhphone.data-api', '.bfh-phone', BFHPhone.prototype.change)
183+
.on('change.bfhphone.data-api', '.bfh-country', BFHPhone.prototype.changeCountry)
184+
})
180185

181186
}(window.jQuery);

0 commit comments

Comments
 (0)