Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
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
Иван Кубота
kus-admin
Commits
2682f572
Commit
2682f572
authored
Jan 29, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format component.
Fix bug with DOM children hooked update.
parent
e4732f08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
10 deletions
+28
-10
DOM.js
src/core/DOM.js
+3
-3
String.Typography.jsx
src/text/String.Typography.jsx
+4
-3
Header.jsx
src/view/block/header/Header.jsx
+7
-4
Format.jsx
src/view/cmp/format/Format.jsx
+14
-0
Account.jsx
src/view/page/account/Account.jsx
+0
-0
No files found.
src/core/DOM.js
View file @
2682f572
...
...
@@ -248,8 +248,8 @@ NS.apply = function(a,b) {
if
(
type
!==
'object'
){
// TODO : add hook
if
(
type
===
'function'
){
//var tmp = D.Text(
);//( {cls: 'zero-wrapper'} );
//
el.appendChild( tmp );
var
tmp
=
D
.
Text
(
''
);
//( {cls: 'zero-wrapper'} );
el
.
appendChild
(
tmp
);
var
list
=
[];
subEl
(
function
(){
...
...
@@ -259,7 +259,7 @@ NS.apply = function(a,b) {
var
fragment
=
document
.
createDocumentFragment
();
D
.
appendChild
(
fragment
,
[].
slice
.
call
(
arguments
)
);
list
=
[].
slice
.
call
(
fragment
.
childNodes
);
el
.
appendChild
(
fragment
);
el
.
insertBefore
(
fragment
,
tmp
);
}
)
}
else
if
(
subEl
!==
void
0
&&
subEl
!==
false
&&
subEl
!==
null
){
el
.
appendChild
(
D
.
Text
(
subEl
)
);
...
...
src/text/String.Typography.js
→
src/text/String.Typography.js
x
View file @
2682f572
var
textCache
=
{};
String
.
Typography
=
function
(
text
,
cfg
)
{
const
{
html
}
=
cfg
;
const
{
html
}
=
cfg
||
{}
;
if
(
typeof
text
!==
'string'
)
return
text
;
...
...
@@ -168,4 +168,5 @@ String.Search = function(string, search) {
}
return
yep
;
};
\ No newline at end of file
};
export
const
Typography
=
String
.
Typography
;
\ No newline at end of file
src/view/block/header/Header.jsx
View file @
2682f572
...
...
@@ -19,12 +19,15 @@ export default D.declare('view.block.Header', () => {
</
button
>
<
div
cls=
{
D
.
cls
({
'hidden'
:
tempPageMenuHidden
})
}
>
{
Object
.
keys
(
Page
).
map
(
name
=>
<
button
class=
"temp-button"
type=
{
'button'
}
onClick=
{
()
=>
store
.
set
(
'navigation.current'
,
name
)
}
>
{
name
}
</
button
>
)
Object
.
keys
(
Page
)
.
map
(
name
=>
<
button
class=
"temp-button"
type=
{
'button'
}
onClick=
{
()
=>
store
.
set
(
'navigation.current'
,
name
)
}
>
{
name
}
</
button
>
)
}
</
div
>
</
div
>
<
IF
condition=
{
NOT
(
store
.
valEqual
(
'navigation.current'
,
'
l
ogin'
))
}
>
<
IF
condition=
{
NOT
(
store
.
valEqual
(
'navigation.current'
,
'
L
ogin'
))
}
>
<
div
className=
"page-header__wrapper"
>
<
a
href=
"#"
class=
"page-header__logo"
aria
-
label=
{
"Логотип ВкусВилл"
}
>
<
Logo
width=
"116"
height=
"41"
/>
...
...
src/view/cmp/format/Format.jsx
0 → 100644
View file @
2682f572
import
{
Typography
}
from
"../../../text/String.Typography"
;
const
Format
=
D
.
declare
(
'view.cmp.Format'
,
(
cfg
,
children
)
=>
{
const
html
=
Typography
(
children
.
join
(
' '
),
{
html
:
cfg
.
html
});
const
div
=
<
div
/>
div
.
innerHTML
=
html
;
return
<>
{
[...
div
.
childNodes
]
}
</>
}
);
export
default
Format
;
export
{
Format
};
\ No newline at end of file
src/view/page/account/Account.jsx
View file @
2682f572
This diff is collapsed.
Click to expand it.
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