Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
9bdb5a56
Commit
9bdb5a56
authored
Sep 06, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Задача 12799] Добавил кнопку асинхронного обновления списка опечаток
parent
1219c841
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
SiteList.jsx
cp/javascript/src/components/SiteList.jsx
+10
-2
style.css
cp/javascript/src/style.css
+23
-2
No files found.
cp/javascript/src/components/SiteList.jsx
View file @
9bdb5a56
import
React
from
'react'
import
{
Nav
,
NavItem
,
NavLink
,
TabContent
,
TabPane
,
Alert
,
Badge
}
from
"reactstrap"
;
import
TypoList
from
"./TypoList/"
;
import
FaRefresh
from
'react-icons/lib/fa/refresh'
;
export
default
class
SiteList
extends
React
.
Component
{
...
...
@@ -8,7 +10,6 @@ export default class SiteList extends React.Component {
super
(
props
);
this
.
sites
=
this
.
props
.
sites
;
this
.
state
=
{
activeTab
:
0
,
error
:
false
,
...
...
@@ -16,6 +17,10 @@ export default class SiteList extends React.Component {
this
.
typos
=
[];
this
.
updateTyposForActiveSite
();
}
updateTyposForActiveSite
=
()
=>
{
this
.
loadSiteTypos
(
this
.
state
.
activeTab
,
()
=>
this
.
forceUpdate
()
);
...
...
@@ -62,6 +67,9 @@ export default class SiteList extends React.Component {
{
this
.
typos
.
length
}
</
Badge
>
</
NavLink
>
{
this
.
state
.
activeTab
===
index
?
<
FaRefresh
className=
"refresh-site"
title=
"Обновить"
onClick=
{
this
.
updateTyposForActiveSite
}
/>
:
null
}
</
NavItem
>
);
...
...
@@ -86,7 +94,7 @@ export default class SiteList extends React.Component {
if
(
this
.
state
.
activeTab
===
index
)
{
return
(
<
TabPane
key=
{
index
}
tabId=
{
index
}
>
<
TypoList
siteId=
{
site
.
id
}
typos=
{
this
.
typos
}
/>
<
TypoList
siteId=
{
site
.
id
}
typos=
{
this
.
typos
}
/>
</
TabPane
>
);
}
else
{
// Если не активная вкладка - то не рендерим содержимое
...
...
cp/javascript/src/style.css
View file @
9bdb5a56
...
...
@@ -3,4 +3,25 @@
margin-left
:
10px
;
color
:
#ffc107
;
background-color
:
#007bff
;
}
\ No newline at end of file
}
.nav-item
{
position
:
relative
;
}
.refresh-site
{
position
:
absolute
;
right
:
10px
;
top
:
13px
;
}
.refresh-site
:hover
{
-webkit-animation
:
spin
2s
linear
infinite
;
-moz-animation
:
spin
2s
linear
infinite
;
animation
:
spin
2s
linear
infinite
;
}
/* Rotation animation */
@-moz-keyframes
spin
{
100
%
{
-moz-transform
:
rotate
(
360deg
);
}
}
@-webkit-keyframes
spin
{
100
%
{
-webkit-transform
:
rotate
(
360deg
);
}
}
@keyframes
spin
{
100
%
{
-webkit-transform
:
rotate
(
360deg
);
transform
:
rotate
(
360deg
);
}
}
\ No newline at end of file
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