* fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint line around directives issue * fix: eslint semi rule * fix: eslint newline per chain rule * fix: eslint space infix ops rule * fix: eslint space-in-parens issue * fix: eslint space before function paren issue * fix: eslint space before blocks issue * fix: eslint arrow body style issue * fix: eslint dot-location issue * fix: eslint quotes issue * fix: eslint quote props issue * fix: eslint operator assignment issue * fix: eslint new line after import issue * fix: indent issues * fix: operator assignment issue * fix: all autofixable eslint issues * fix: all react related fixable issues * fix: autofixable eslint issues * chore: remove all template literals * fix: remaining autofixable issues * fix: failing js test
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import * as domReady from 'domReady';
|
|
import * as $ from 'jquery';
|
|
import 'jquery.smoothScroll';
|
|
|
|
'use strict';
|
|
|
|
var toggleSock = function(e) {
|
|
e.preventDefault();
|
|
|
|
var $btnShowSockLabel = $(this).find('.copy-show');
|
|
var $btnHideSockLabel = $(this).find('.copy-hide');
|
|
var $sock = $('.wrapper-sock');
|
|
var $sockContent = $sock.find('.wrapper-inner');
|
|
|
|
if ($sock.hasClass('is-shown')) {
|
|
$sock.removeClass('is-shown');
|
|
$sockContent.hide('fast');
|
|
$btnHideSockLabel.removeClass('is-shown').addClass('is-hidden');
|
|
$btnShowSockLabel.removeClass('is-hidden').addClass('is-shown');
|
|
} else {
|
|
$sock.addClass('is-shown');
|
|
$sockContent.show('fast');
|
|
$btnHideSockLabel.removeClass('is-hidden').addClass('is-shown');
|
|
$btnShowSockLabel.removeClass('is-shown').addClass('is-hidden');
|
|
}
|
|
|
|
$.smoothScroll({
|
|
offset: -200,
|
|
easing: 'swing',
|
|
speed: 1000,
|
|
scrollElement: null,
|
|
scrollTarget: $sock
|
|
});
|
|
};
|
|
|
|
domReady(function() {
|
|
// toggling footer additional support
|
|
$('.cta-show-sock').bind('click', toggleSock);
|
|
});
|
|
|
|
export {toggleSock};
|