if (typeof errorId === 'undefined') {
errorId = GetYoDigits(6, 'abide-error');
$error.attr('id', errorId);
- };
+ }
$el.attr('aria-describedby', errorId);
}
if (typeof elemId === 'undefined') {
elemId = GetYoDigits(6, 'abide-input');
$el.attr('id', elemId);
- };
+ }
// For each label targeting $el, set [for] if it is not set.
$labels.each((i, label) => {
valid = true;
}
});
- };
+ }
return valid;
}
if (checked >= minRequired) {
valid = true;
}
- };
+ }
// Skip validation if more than 1 checkbox have to be checked AND if the form hasn't got submitted yet (otherwise it will already show an error during the first fill in)
if (this.initialized !== true && minRequired > 1) {
if ($anchor && $link && $link.length) {
if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
this._openSingleTab($anchor);
- };
+ }
}
// Otherwise, close everything
else {
// Get the anchor ID or create one
if (typeof this.$currentAnchor.attr('id') === 'undefined') {
this.$currentAnchor.attr('id', GetYoDigits(6, 'dd-anchor'));
- };
+ }
this.$element.attr('aria-labelledby', this.$currentAnchor.attr('id'));
}
.on('click.zf.trigger', function(e) {
_this._setCurrentAnchor(this);
- if (_this.options.forceFollow === false) {
+ if (
// if forceFollow false, always prevent default action
- e.preventDefault();
- } else if (hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false) {
+ (_this.options.forceFollow === false) ||
// if forceFollow true and hover option true, only prevent default action on 1st click
// on 2nd click (dropown opened) the default action (e.g. follow a href) gets executed
+ (hasTouch && _this.options.hover && _this.$element.hasClass('is-open') === false)
+ ) {
e.preventDefault();
}
});
this.className = 'ResponsiveAccordionTabs'; // ie9 back compat
if (!this.$element.attr('id')) {
this.$element.attr('id',GetYoDigits(6, 'responsiveaccordiontabs'));
- };
+ }
this._init();
this._events();
if ($panels.length) fromString = 'tabs';
if (fromString === toSet) {
return;
- };
+ }
var tabsTitle = _this.allOptions.linkClass?_this.allOptions.linkClass:'tabs-title';
var tabsPanel = _this.allOptions.panelClass?_this.allOptions.panelClass:'tabs-panel';
$panels.children('a').removeAttr('role').removeAttr('aria-controls').removeAttr('aria-selected');
}else{
$panels = $liHeads.children('[data-tab-content]').removeClass('accordion-content');
- };
+ }
$panels.css({display:'',visibility:''});
$liHeads.css({display:'',visibility:''});
$placeholder.remove();
}else{
$tabsContent = $('<div class="tabs-content"></div>').insertAfter(_this.$element).attr('data-tabs-content',_this.$element.attr('id'));
- };
+ }
$panels.each(function(key,value){
var tempValue = $(value).appendTo($tabsContent).addClass(tabsPanel);
var hash = $liHeadsA.get(key).hash.slice(1);
hash = id;
$(value).attr('id',hash);
$($liHeadsA.get(key)).attr('href',$($liHeadsA.get(key)).attr('href').replace('#','')+'#'+hash);
- };
- };
+ }
+ }
var isActive = $($liHeads.get(key)).hasClass('is-active');
if (isActive) {
tempValue.addClass('is-active');
- };
+ }
});
$liHeads.addClass(tabsTitle);
};
*/
function ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {
return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;
-};
+}
function OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {
var eleDims = GetDimensions(element),