* @private
*/
Orbit.prototype._init = function(){
- this.$wrapper = this.$element.find('.' + this.options.containerClass);
- this.$slides = this.$element.find('.' + this.options.slideClass);
+ this.$wrapper = this.$element.find(`.${this.options.containerClass}`);
+ this.$slides = this.$element.find(`.${this.options.slideClass}`);
var $images = this.$element.find('img'),
initActive = this.$slides.filter('.is-active');
* @private
*/
Orbit.prototype._loadBullets = function(){
- this.$bullets = this.$element.find('.' + this.options.boxOfBullets).find('button');
+ this.$bullets = this.$element.find(`.${this.options.boxOfBullets}`).find('button');
};
/**
* Sets a `timer` object on the orbit, and starts the counter for the next slide.
}
if(this.options.navButtons){
- var $controls = this.$element.find('.' + this.options.nextClass + ', .' + this.options.prevClass);
+ var $controls = this.$element.find(`.${this.options.nextClass}, .${this.options.prevClass}`);
$controls.attr('tabindex', 0)
//also need to handle enter/return and spacebar key presses
.on('click.zf.orbit touchend.zf.orbit', function(){
if(!chosenSlide){//most of the time, this will be auto played or clicked from the navButtons.
$newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!
- (this.options.infiniteWrap ? $curSlide.next('.' + this.options.slideClass).length ? $curSlide.next('.' + this.options.slideClass) : $firstSlide : $curSlide.next('.' + this.options.slideClass))//pick next slide if moving left to right
+ (this.options.infiniteWrap ? $curSlide.next(`.${this.options.slideClass}`).length ? $curSlide.next(`.${this.options.slideClass}`) : $firstSlide : $curSlide.next(`.${this.options.slideClass}`))//pick next slide if moving left to right
:
- (this.options.infiniteWrap ? $curSlide.prev('.' + this.options.slideClass).length ? $curSlide.prev('.' + this.options.slideClass) : $lastSlide : $curSlide.prev('.' + this.options.slideClass));//pick prev slide if moving right to left
+ (this.options.infiniteWrap ? $curSlide.prev(`.${this.options.slideClass}`).length ? $curSlide.prev(`.${this.options.slideClass}`) : $lastSlide : $curSlide.prev(`.${this.options.slideClass}`));//pick prev slide if moving right to left
}else{
$newSlide = chosenSlide;
}
Foundation.Motion.animateIn(
$newSlide.addClass('is-active').css({'position': 'absolute', 'top': 0}),
- this.options['animInFrom' + dirIn],
+ this.options[`animInFrom${dirIn}`],
function(){
$newSlide.css({'position': 'relative', 'display': 'block'})
.attr('aria-live', 'polite');
Foundation.Motion.animateOut(
$curSlide.removeClass('is-active'),
- this.options['animOutTo' + dirOut],
+ this.options[`animOutTo${dirOut}`],
function(){
$curSlide.removeAttr('aria-live');
if(_this.options.autoPlay && !_this.timer.isPaused){
* @param {Number} idx - the index of the current slide.
*/
Orbit.prototype._updateBullets = function(idx){
- var $oldBullet = this.$element.find('.' + this.options.boxOfBullets)
+ var $oldBullet = this.$element.find(`.${this.options.boxOfBullets}`)
.find('.is-active').removeClass('is-active').blur(),
span = $oldBullet.find('span:last').detach(),
$newBullet = this.$bullets.eq(idx).addClass('is-active').append(span);
this.id = this.$element.attr('id');
this.isActive = false;
- this.$anchor = $('[data-open="' + this.id + '"]').length ? $('[data-open="' + this.id + '"]') : $('[data-toggle="' + this.id + '"]');
+ this.$anchor = $(`[data-open="${this.id}"]`).length ? $(`[data-open="${this.id}"]`) : $(`[data-toggle="${this.id}"]`);
if(this.$anchor.length){
var anchorId = this.$anchor[0].id || Foundation.GetYoDigits(6, 'reveal');
});
this._events();
- if(this.options.deepLink && window.location.hash === ( '#' + this.id)){
+ if(this.options.deepLink && window.location.hash === ( `#${this.id}`)){
$(window).one('load.zf.reveal', this.open.bind(this));
}
};
this.$overlay.off('.zf.reveal').on('click.zf.reveal', this.close.bind(this));
}
if(this.options.deepLink){
- $(window).on('popstate.zf.reveal:' + this.id, this._handleState.bind(this));
+ $(window).on(`popstate.zf.reveal:${this.id}`, this._handleState.bind(this));
}
};
/**
* @private
*/
Reveal.prototype._handleState = function(e){
- if(window.location.hash === ( '#' + this.id) && !this.isActive){ this.open(); }
+ if(window.location.hash === ( `#${this.id}`) && !this.isActive){ this.open(); }
else{ this.close(); }
};
/**
*/
Reveal.prototype.open = function(){
if(this.options.deepLink){
- var hash = '#' + this.id;
+ var hash = `#${this.id}`;
if(window.history.pushState){
window.history.pushState(null, null, hash);
}
this.$element.hide().off();
this.$anchor.off('.zf');
- $(window).off('.zf.reveal:' + this.id);
+ $(window).off(`.zf.reveal:${this.id}`);
Foundation.unregisterPlugin(this);
};