Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
9a4617e8
Commit
9a4617e8
authored
Feb 13, 2018
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправления JS для случаев отсутствия разметки JS-компонентов
parent
4576b521
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
77 deletions
+88
-77
nouislider.js
src/blocks/nouislider/nouislider.js
+30
-26
swipe.js
src/blocks/swipe/swipe.js
+16
-13
to-top.js
src/blocks/to-top/to-top.js
+42
-38
No files found.
src/blocks/nouislider/nouislider.js
View file @
9a4617e8
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(){
if
(
document
.
getElementById
(
'demo-nouislider'
))
{
var
demoNoUiSlider
=
document
.
getElementById
(
'demo-nouislider'
);
var
demoNoUiSliderStartInput
=
document
.
getElementById
(
'demo-nouislider-start'
);
var
demoNoUiSliderEndInput
=
document
.
getElementById
(
'demo-nouislider-end'
);
...
...
@@ -27,4 +29,6 @@ document.addEventListener('DOMContentLoaded', function(){
demoNoUiSlider
.
noUiSlider
.
set
([
this
.
value
,
null
]);
});
}
});
src/blocks/swipe/swipe.js
View file @
9a4617e8
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(){
if
(
document
.
getElementById
(
'swipe-demo'
))
{
window
.
mySwipe
=
new
Swipe
(
document
.
getElementById
(
'swipe-demo'
),
{
startSlide
:
0
,
speed
:
400
,
...
...
@@ -15,4 +17,5 @@ document.addEventListener('DOMContentLoaded', function(){
// включить видимость блока (по умолчанию скрыт)
document
.
getElementById
(
'swipe-demo'
).
classList
.
add
(
'swipe--enable'
);
}
});
src/blocks/to-top/to-top.js
View file @
9a4617e8
document
.
addEventListener
(
'DOMContentLoaded'
,
function
(){
document
.
querySelector
(
'#to-top'
).
addEventListener
(
'click'
,
function
(
e
)
{
if
(
document
.
getElementById
(
'to-top'
))
{
document
.
getElementById
(
'to-top'
).
addEventListener
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
var
scroll
=
window
.
pageYOffset
;
var
targetTop
=
0
;
...
...
@@ -22,10 +24,10 @@ document.addEventListener('DOMContentLoaded', function(){
function
visibilityToggle
()
{
if
(
window
.
pageYOffset
>=
500
)
{
document
.
querySelector
(
'#
to-top'
).
classList
.
add
(
'to-top--visible'
);
document
.
getElementById
(
'
to-top'
).
classList
.
add
(
'to-top--visible'
);
}
else
{
document
.
querySelector
(
'#
to-top'
).
classList
.
remove
(
'to-top--visible'
);
document
.
getElementById
(
'
to-top'
).
classList
.
remove
(
'to-top--visible'
);
}
}
...
...
@@ -45,4 +47,6 @@ document.addEventListener('DOMContentLoaded', function(){
});
}
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment