Skip to content

Commit 73ead6e

Browse files
committed
fix typo while improving variable name
1 parent 3d37e23 commit 73ead6e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/jquery.selectric.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
var pluginName = 'selectric';
3030
var classList = 'Input Items Open Disabled TempShow HideSelect Wrapper Focus Hover Responsive Above Scroll Group GroupLabel';
31-
var bindSufix = '.sl';
31+
var eventNamespaceSuffix = '.sl';
3232

3333
var chars = ['a', 'e', 'i', 'o', 'u', 'n', 'c', 'y'];
3434
var diacritics = [
@@ -534,9 +534,9 @@
534534
.add(_this.$element)
535535
.add(_this.elements.outerWrapper)
536536
.add(_this.elements.input)
537-
.off(bindSufix);
537+
.off(eventNamespaceSuffix);
538538

539-
_this.elements.outerWrapper.on('mouseenter' + bindSufix + ' mouseleave' + bindSufix, function(e) {
539+
_this.elements.outerWrapper.on('mouseenter' + eventNamespaceSuffix + ' mouseleave' + eventNamespaceSuffix, function(e) {
540540
$(this).toggleClass(_this.classes.hover, e.type === 'mouseenter');
541541

542542
// Delay close effect when openOnHover is true
@@ -552,19 +552,19 @@
552552
});
553553

554554
// Toggle open/close
555-
_this.elements.wrapper.on('click' + bindSufix, function(e) {
555+
_this.elements.wrapper.on('click' + eventNamespaceSuffix, function(e) {
556556
_this.state.opened ? _this.close() : _this.open(e);
557557
});
558558

559559
// Translate original element focus event to dummy input
560-
_this.$element.on('focus' + bindSufix, function() {
560+
_this.$element.on('focus' + eventNamespaceSuffix, function() {
561561
_this.elements.input.focus();
562562
});
563563

564564
_this.elements.input
565565
.prop({ tabindex: _this.originalTabindex, disabled: false })
566-
.on('keydown' + bindSufix, $.proxy(_this.handleKeys, _this))
567-
.on('focusin' + bindSufix, function(e) {
566+
.on('keydown' + eventNamespaceSuffix, $.proxy(_this.handleKeys, _this))
567+
.on('focusin' + eventNamespaceSuffix, function(e) {
568568
_this.elements.outerWrapper.addClass(_this.classes.focus);
569569

570570
// Prevent the flicker when focusing out and back again in the browser window
@@ -576,7 +576,7 @@
576576
_this.open(e);
577577
}
578578
})
579-
.on('focusout' + bindSufix, function() {
579+
.on('focusout' + eventNamespaceSuffix, function() {
580580
_this.elements.outerWrapper.removeClass(_this.classes.focus);
581581
})
582582
.on('input propertychange', function() {
@@ -802,16 +802,16 @@
802802
// Delayed binds events on Document to make label clicks work
803803
setTimeout(function() {
804804
$doc
805-
.on('click' + bindSufix, $.proxy(_this.close, _this))
806-
.on('scroll' + bindSufix, $.proxy(_this.isInViewport, _this));
805+
.on('click' + eventNamespaceSuffix, $.proxy(_this.close, _this))
806+
.on('scroll' + eventNamespaceSuffix, $.proxy(_this.isInViewport, _this));
807807
}, 1);
808808

809809
_this.isInViewport();
810810

811811
// Prevent window scroll when using mouse wheel inside items box
812812
if ( _this.options.preventWindowScroll ) {
813813
/* istanbul ignore next */
814-
$doc.on('mousewheel' + bindSufix + ' DOMMouseScroll' + bindSufix, '.' + _this.classes.scroll, function(e) {
814+
$doc.on('mousewheel' + eventNamespaceSuffix + ' DOMMouseScroll' + eventNamespaceSuffix, '.' + _this.classes.scroll, function(e) {
815815
var orgEvent = e.originalEvent;
816816
var scrollTop = $(this).scrollTop();
817817
var deltaY = 0;
@@ -842,7 +842,7 @@
842842
_this.utils.triggerCallback('BeforeClose', _this);
843843

844844
// Remove custom events on document
845-
$doc.off(bindSufix);
845+
$doc.off(eventNamespaceSuffix);
846846

847847
// Remove visible class to hide options box
848848
_this.elements.outerWrapper.removeClass(_this.classes.open);
@@ -966,7 +966,7 @@
966966
_this.$element.removeData(pluginName).removeData('value');
967967
}
968968

969-
_this.$element.prop('tabindex', _this.originalTabindex).off(bindSufix).off(_this.eventTriggers).unwrap().unwrap();
969+
_this.$element.prop('tabindex', _this.originalTabindex).off(eventNamespaceSuffix).off(_this.eventTriggers).unwrap().unwrap();
970970

971971
_this.state.enabled = false;
972972
}

0 commit comments

Comments
 (0)