Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0c46b3b8
Commit
0c46b3b8
authored
May 04, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use computed css class for animations
parent
c59f80ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
28 deletions
+30
-28
app/assets/javascripts/issue_show/issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+30
-28
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
0c46b3b8
...
@@ -29,15 +29,22 @@ export default {
...
@@ -29,15 +29,22 @@ export default {
},
},
});
});
const
defaultFlags
=
{
pre
:
true
,
pulse
:
false
,
};
return
{
return
{
poll
,
poll
,
apiData
:
{},
apiData
:
{},
tasks
:
'
0 of 0
'
,
title
:
null
,
title
:
null
,
titleText
:
''
,
titleText
:
''
,
t
asks
:
'
0 of 0
'
,
t
itleFlag
:
defaultFlags
,
description
:
null
,
description
:
null
,
descriptionText
:
''
,
descriptionText
:
''
,
descriptionChange
:
false
,
descriptionChange
:
false
,
descriptionFlag
:
defaultFlags
,
timeAgoEl
:
$
(
'
.issue_edited_ago
'
),
timeAgoEl
:
$
(
'
.issue_edited_ago
'
),
titleEl
:
document
.
querySelector
(
'
title
'
),
titleEl
:
document
.
querySelector
(
'
title
'
),
};
};
...
@@ -51,11 +58,9 @@ export default {
...
@@ -51,11 +58,9 @@ export default {
tasks
(
this
.
apiData
,
this
.
tasks
);
tasks
(
this
.
apiData
,
this
.
tasks
);
},
},
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
)
{
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
)
{
const
elementStack
=
[];
if
(
!
noTitleChange
)
{
if
(
!
noTitleChange
)
{
this
.
titleText
=
this
.
apiData
.
title_text
;
this
.
titleText
=
this
.
apiData
.
title_text
;
elementStack
.
push
(
this
.
$refs
[
'
issue-title
'
])
;
this
.
titleFlag
=
{
pre
:
true
,
pulse
:
false
}
;
}
}
if
(
!
noDescriptionChange
)
{
if
(
!
noDescriptionChange
)
{
...
@@ -63,35 +68,24 @@ export default {
...
@@ -63,35 +68,24 @@ export default {
this
.
descriptionChange
=
true
;
this
.
descriptionChange
=
true
;
this
.
updateTaskHTML
();
this
.
updateTaskHTML
();
this
.
tasks
=
this
.
apiData
.
task_status
;
this
.
tasks
=
this
.
apiData
.
task_status
;
elementStack
.
push
(
this
.
$refs
[
'
issue-content-container-gfm-entry
'
])
;
this
.
descriptionFlag
=
{
pre
:
true
,
pulse
:
false
}
;
}
}
elementStack
.
forEach
((
element
)
=>
{
return
{
noTitleChange
,
noDescriptionChange
};
if
(
element
)
{
element
.
classList
.
remove
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-pre-pulse
'
);
}
});
return
elementStack
;
},
},
setTabTitle
()
{
setTabTitle
()
{
const
currentTabTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
const
currentTabTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
currentTabTitleScope
[
0
]
=
`
${
this
.
titleText
}
(#
${
this
.
apiData
.
issue_number
}
) `
;
currentTabTitleScope
[
0
]
=
`
${
this
.
titleText
}
(#
${
this
.
apiData
.
issue_number
}
) `
;
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
},
},
animate
(
title
,
description
,
elementsToVisualize
)
{
animate
(
title
,
description
)
{
this
.
title
=
title
;
this
.
title
=
title
;
this
.
description
=
description
;
this
.
description
=
description
;
this
.
setTabTitle
();
this
.
setTabTitle
();
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
elementsToVisualize
.
forEach
((
element
)
=>
{
this
.
titleFlag
=
{
pre
:
false
,
pulse
:
true
};
if
(
element
)
{
this
.
descriptionFlag
=
{
pre
:
false
,
pulse
:
true
};
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
}
});
});
});
},
},
triggerAnimation
()
{
triggerAnimation
()
{
...
@@ -110,12 +104,8 @@ export default {
...
@@ -110,12 +104,8 @@ export default {
*/
*/
if
(
noTitleChange
&&
noDescriptionChange
)
return
;
if
(
noTitleChange
&&
noDescriptionChange
)
return
;
const
elementsToVisualize
=
this
.
elementsToVisualize
(
this
.
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
);
noTitleChange
,
this
.
animate
(
title
,
description
);
noDescriptionChange
,
);
this
.
animate
(
title
,
description
,
elementsToVisualize
);
},
},
updateEditedTimeAgo
()
{
updateEditedTimeAgo
()
{
const
toolTipTime
=
gl
.
utils
.
formatDate
(
this
.
apiData
.
updated_at
);
const
toolTipTime
=
gl
.
utils
.
formatDate
(
this
.
apiData
.
updated_at
);
...
@@ -128,6 +118,18 @@ export default {
...
@@ -128,6 +118,18 @@ export default {
descriptionClass
()
{
descriptionClass
()
{
return
`description
${
this
.
canUpdateIssue
}
is-task-list-enabled`
;
return
`description
${
this
.
canUpdateIssue
}
is-task-list-enabled`
;
},
},
titleAnimationCss
()
{
return
{
'
title issue-realtime-pre-pulse
'
:
this
.
titleFlag
.
pre
,
'
title issue-realtime-trigger-pulse
'
:
this
.
titleFlag
.
pulse
,
};
},
descriptionAnimationCss
()
{
return
{
'
wiki issue-realtime-pre-pulse
'
:
this
.
descriptionFlag
.
pre
,
'
wiki issue-realtime-trigger-pulse
'
:
this
.
descriptionFlag
.
pulse
,
};
},
},
},
created
()
{
created
()
{
if
(
!
Visibility
.
hidden
())
{
if
(
!
Visibility
.
hidden
())
{
...
@@ -166,7 +168,7 @@ export default {
...
@@ -166,7 +168,7 @@ export default {
<
template
>
<
template
>
<div>
<div>
<h2
<h2
class=
"title issue-realtime-trigger-pulse
"
:class=
"titleAnimationCss
"
ref=
"issue-title"
ref=
"issue-title"
v-html=
"title"
v-html=
"title"
>
>
...
@@ -176,7 +178,7 @@ export default {
...
@@ -176,7 +178,7 @@ export default {
v-if=
"description"
v-if=
"description"
>
>
<div
<div
class=
"wiki issue-realtime-trigger-pulse
"
:class=
"descriptionAnimationCss
"
v-html=
"description"
v-html=
"description"
ref=
"issue-content-container-gfm-entry"
ref=
"issue-content-container-gfm-entry"
>
>
...
...
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