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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
05c409d2
Commit
05c409d2
authored
May 04, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use nextTick and cache timeAgoEl
parent
7a37ada1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
app/assets/javascripts/issue_show/issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+10
-10
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
05c409d2
<
script
>
<
script
>
import
Vue
from
'
vue
'
;
import
Visibility
from
'
visibilityjs
'
;
import
Visibility
from
'
visibilityjs
'
;
import
Poll
from
'
./../lib/utils/poll
'
;
import
Poll
from
'
./../lib/utils/poll
'
;
import
Service
from
'
./services/index
'
;
import
Service
from
'
./services/index
'
;
...
@@ -37,13 +38,13 @@ export default {
...
@@ -37,13 +38,13 @@ export default {
return
{
return
{
poll
,
poll
,
apiData
:
{},
apiData
:
{},
timeoutId
:
null
,
title
:
null
,
title
:
null
,
titleText
:
''
,
titleText
:
''
,
tasks
:
'
0 of 0
'
,
description
:
null
,
description
:
null
,
descriptionText
:
''
,
descriptionText
:
''
,
descriptionChange
:
false
,
descriptionChange
:
false
,
t
asks
:
'
0 of 0
'
,
t
imeAgoEl
:
$
(
'
.issue_edited_ago
'
)
,
titleEl
:
document
.
querySelector
(
'
title
'
),
titleEl
:
document
.
querySelector
(
'
title
'
),
};
};
},
},
...
@@ -86,18 +87,18 @@ export default {
...
@@ -86,18 +87,18 @@ export default {
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
},
},
animate
(
title
,
description
,
elementsToVisualize
)
{
animate
(
title
,
description
,
elementsToVisualize
)
{
this
.
timeoutId
=
setTimeout
(()
=>
{
this
.
title
=
title
;
this
.
title
=
title
;
this
.
description
=
description
;
this
.
description
=
description
;
this
.
setTabTitle
();
this
.
setTabTitle
();
Vue
.
nextTick
(()
=>
{
elementsToVisualize
.
forEach
((
element
)
=>
{
elementsToVisualize
.
forEach
((
element
)
=>
{
if
(
element
)
{
if
(
element
)
{
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
}
}
});
});
}
,
0
);
});
},
},
triggerAnimation
()
{
triggerAnimation
()
{
// always reset to false before checking the change
// always reset to false before checking the change
...
@@ -124,10 +125,9 @@ export default {
...
@@ -124,10 +125,9 @@ export default {
},
},
updateEditedTimeAgo
()
{
updateEditedTimeAgo
()
{
const
toolTipTime
=
gl
.
utils
.
formatDate
(
this
.
apiData
.
updated_at
);
const
toolTipTime
=
gl
.
utils
.
formatDate
(
this
.
apiData
.
updated_at
);
const
$timeAgoNode
=
$
(
'
.issue_edited_ago
'
);
$timeAgoNode
.
attr
(
'
datetime
'
,
this
.
apiData
.
updated_at
);
this
.
timeAgoEl
.
attr
(
'
datetime
'
,
this
.
apiData
.
updated_at
);
$timeAgoNode
.
attr
(
'
data-original-title
'
,
toolTipTime
);
this
.
timeAgoEl
.
attr
(
'
data-original-title
'
,
toolTipTime
);
},
},
},
},
computed
:
{
computed
:
{
...
...
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