sedona-blocks
Advanced tools
Comparing version 3.14.7 to 3.14.8
{ | ||
"name": "sedona-blocks", | ||
"version": "3.14.7", | ||
"version": "3.14.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,3 +5,3 @@ // Carousel | ||
window.sedona.carousel = function() { | ||
if (document.querySelector('.carousel') === null) { | ||
if (!document.querySelector('.carousel')) { | ||
return; | ||
@@ -8,0 +8,0 @@ } |
@@ -5,3 +5,3 @@ // File | ||
window.sedona.file = function() { | ||
if (document.querySelector('.file[type="file"]') === null) { | ||
if (!document.querySelector('.file[type="file"]')) { | ||
return; | ||
@@ -8,0 +8,0 @@ } |
@@ -6,3 +6,3 @@ // Form Validate | ||
validate: function() { | ||
if (document.querySelector('form[novalidate]') !== null) { | ||
if (document.querySelector('form[novalidate]')) { | ||
const form = document.querySelectorAll('form[novalidate]'); | ||
@@ -12,3 +12,3 @@ | ||
el.addEventListener('submit', function(evt) { | ||
if (el.querySelector('[required]') !== null) { | ||
if (el.querySelector('[required]')) { | ||
const required = el.querySelectorAll('[required]'); | ||
@@ -21,3 +21,3 @@ | ||
if (el.querySelector('[minlength]') !== null) { | ||
if (el.querySelector('[minlength]')) { | ||
const minlength = el.querySelectorAll('[minlength]'); | ||
@@ -30,3 +30,3 @@ | ||
if (el.querySelector('[type="email"]') !== null) { | ||
if (el.querySelector('[type="email"]')) { | ||
const email = el.querySelectorAll('[type="email"]'); | ||
@@ -39,3 +39,3 @@ | ||
if (el.querySelector('.form__control--danger') !== null) { | ||
if (el.querySelector('.form__control--danger')) { | ||
evt.preventDefault(); | ||
@@ -51,3 +51,3 @@ | ||
if (document.querySelector('form[novalidate] [minlength]') !== null) { | ||
if (document.querySelector('form[novalidate] [minlength]')) { | ||
const minlength = document.querySelectorAll('form[novalidate] [minlength]'); | ||
@@ -66,3 +66,3 @@ | ||
if (document.querySelector('form[novalidate] [type="email"]') !== null) { | ||
if (document.querySelector('form[novalidate] [type="email"]')) { | ||
const email = document.querySelectorAll('form[novalidate] [type="email"]'); | ||
@@ -136,5 +136,5 @@ | ||
function sedonaFormValidateRemoveDangerHint(el) { | ||
if (el.parentElement.nextElementSibling !== null && el.parentElement.nextElementSibling.classList.contains('form__hint--danger')) { | ||
if (el.parentElement.nextElementSibling && el.parentElement.nextElementSibling.classList.contains('form__hint--danger')) { | ||
el.parentElement.parentElement.removeChild(el.parentElement.nextElementSibling); | ||
} | ||
} |
@@ -5,3 +5,3 @@ // Header | ||
window.sedona.header = function() { | ||
if (document.querySelector('.header') === null) { | ||
if (!document.querySelector('.header')) { | ||
return; | ||
@@ -11,2 +11,19 @@ } | ||
const header = document.querySelector('.header'); | ||
window.onscroll = function() { | ||
if (!header.classList.contains('header--fixed')) { | ||
return; | ||
} | ||
if (this.pageYOffset > 0) { | ||
header.classList.add('header--scrollable'); | ||
} else { | ||
header.classList.remove('header--scrollable'); | ||
} | ||
}; | ||
if (!header.querySelector('.js-header-toggle')) { | ||
return; | ||
} | ||
const headerCollapse = header.querySelector('.header__collapse'); | ||
@@ -23,5 +40,7 @@ const main = document.querySelector('.main'); | ||
footer.style.top = footer.offsetTop - scrTop + 'px'; | ||
footer.style.position = 'fixed'; | ||
footer.style.overflow = 'hidden'; | ||
if (footer) { | ||
footer.style.top = footer.offsetTop - scrTop + 'px'; | ||
footer.style.position = 'fixed'; | ||
footer.style.overflow = 'hidden'; | ||
} | ||
@@ -46,5 +65,7 @@ main.style.top = -scrTop + 'px'; | ||
footer.style.top = ''; | ||
footer.style.position = ''; | ||
footer.style.overflow = ''; | ||
if (footer) { | ||
footer.style.top = ''; | ||
footer.style.position = ''; | ||
footer.style.overflow = ''; | ||
} | ||
@@ -59,16 +80,4 @@ main.style.top = ''; | ||
}); | ||
window.onscroll = function() { | ||
if (!header.classList.contains('header--fixed')) { | ||
return; | ||
} | ||
if (this.pageYOffset > 0) { | ||
header.classList.add('header--scrollable'); | ||
} else { | ||
header.classList.remove('header--scrollable'); | ||
} | ||
}; | ||
} | ||
sedona.header(); |
@@ -21,2 +21,4 @@ # Шапка | ||
@header-font-size: inherit; | ||
@header-line-height: inherit; | ||
@header-font-family: inherit; | ||
@@ -23,0 +25,0 @@ |
@@ -5,3 +5,3 @@ // Notify | ||
window.sedona.notify = function() { | ||
if (document.querySelector('.notify') === null) { | ||
if (!document.querySelector('.notify')) { | ||
return; | ||
@@ -8,0 +8,0 @@ } |
@@ -5,3 +5,3 @@ // Table | ||
window.sedona.table = function() { | ||
if (document.querySelector('.table .table__wrap') === null) { | ||
if (!document.querySelector('.table .table__wrap')) { | ||
return; | ||
@@ -8,0 +8,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
378
240439