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
b96cbe66
Commit
b96cbe66
authored
Apr 02, 2019
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:nicothin/NTH-start-project
parents
1c950919
c4edddd8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
29 deletions
+52
-29
field-num.js
src/blocks/field-num/field-num.js
+18
-16
404.pug
src/pages/404.pug
+21
-0
index.pug
src/pages/index.pug
+4
-9
layout.pug
src/pug/layout.pug
+9
-4
No files found.
src/blocks/field-num/field-num.js
View file @
b96cbe66
...
...
@@ -5,23 +5,25 @@ const ready = require('../../js/utils/documentReady.js');
ready
(
function
(){
var
fields
=
document
.
querySelectorAll
(
'.field-num'
);
Array
.
prototype
.
forEach
.
call
(
fields
,
function
(
field
)
{
const
input
=
field
.
querySelector
(
'.field-num__input'
);
const
valueMin
=
input
.
getAttribute
(
'min'
)
?
+
input
.
getAttribute
(
'min'
)
:
-
Infinity
;
const
valueMax
=
input
.
getAttribute
(
'max'
)
?
+
input
.
getAttribute
(
'max'
)
:
Infinity
;
const
valueStep
=
input
.
getAttribute
(
'step'
)
?
+
input
.
getAttribute
(
'step'
)
:
1
;
field
.
addEventListener
(
'click'
,
function
(
event
){
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn'
)
&&
!
input
.
getAttribute
(
'disabled'
))
{
let
num
=
parseInt
(
input
.
value
);
if
(
isNaN
(
num
))
num
=
0
;
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn--plus'
))
{
if
(
num
<
valueMax
)
input
.
value
=
num
+
valueStep
;
if
(
fields
.
length
)
{
Array
.
prototype
.
forEach
.
call
(
fields
,
function
(
field
)
{
const
input
=
field
.
querySelector
(
'.field-num__input'
);
const
valueMin
=
input
.
getAttribute
(
'min'
)
?
+
input
.
getAttribute
(
'min'
)
:
-
Infinity
;
const
valueMax
=
input
.
getAttribute
(
'max'
)
?
+
input
.
getAttribute
(
'max'
)
:
Infinity
;
const
valueStep
=
input
.
getAttribute
(
'step'
)
?
+
input
.
getAttribute
(
'step'
)
:
1
;
field
.
addEventListener
(
'click'
,
function
(
event
){
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn'
)
&&
!
input
.
getAttribute
(
'disabled'
))
{
let
num
=
parseInt
(
input
.
value
);
if
(
isNaN
(
num
))
num
=
0
;
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn--plus'
))
{
if
(
num
<
valueMax
)
input
.
value
=
num
+
valueStep
;
}
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn--minus'
))
{
if
(
num
>
valueMin
)
input
.
value
=
num
-
valueStep
;
}
}
if
(
event
.
target
.
classList
.
contains
(
'field-num__btn--minus'
))
{
if
(
num
>
valueMin
)
input
.
value
=
num
-
valueStep
;
}
}
});
});
}
);
}
});
src/pages/404.pug
0 → 100644
View file @
b96cbe66
extends ../pug/layout.pug
block meta
title Error 404
meta(name='description', content='')
//- block append head
//- link(rel='stylesheet', href='css/some.css')
block nav
+main-nav('-1')
block content
h1 Error 404
p Page not found.
//- block footer
//- p footer
//- block append page-bottom
//- script(src='js/some.js')
src/pages/index.pug
View file @
b96cbe66
...
...
@@ -7,20 +7,15 @@ block meta
//- block append head
//- link(rel='stylesheet', href='css/some.css')
block header
+page-header()
+logo('/')
img(src='img/demo-logo.svg', alt='Logo', width='64', height='15')
+main-nav('10')
block nav
+main-nav('10')
block content
h1 Заголовок
p Содержимое. #[a(href='blocks-demo.html') Библиотека блоков].
block footer
+page-footer()
p «Подвал»
p Контактный телефон: #[a(href='tel:+70000000000') +7 000 000 00 00]
//- block footer
//- p footer
//- block append page-bottom
//- script(src='js/some.js')
src/pug/layout.pug
View file @
b96cbe66
...
...
@@ -38,13 +38,18 @@ html(class='page no-js', lang='ru')
.page__inner
.page__content
block header
p шапка
+page-header()
+logo('/')
img(src='img/demo-logo.svg', alt='Logo', width='64', height='15')
block nav
block content
p содержимое
.page__footer-wrapper
block footer
p подвал
+page-footer()
block footer
p «Подвал»
p Контактный телефон: #[a(href='tel:+70000000000') +7 000 000 00 00]
block page-bottom
script(src='js/bundle.js')
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