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
Jérome Perrin
gitlab-ce
Commits
7a37ada1
Commit
7a37ada1
authored
May 04, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use refs when possible - style changes - better initial title and description data types
parent
4fd87421
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
app/assets/javascripts/issue_show/issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+34
-18
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
7a37ada1
...
...
@@ -6,8 +6,14 @@ import tasks from './actions/tasks';
export
default
{
props
:
{
endpoint
:
{
required
:
true
,
type
:
String
},
candescription
:
{
required
:
true
,
type
:
String
},
endpoint
:
{
required
:
true
,
type
:
String
,
},
candescription
:
{
required
:
true
,
type
:
String
,
},
},
data
()
{
const
resource
=
new
Service
(
this
.
$http
,
this
.
endpoint
);
...
...
@@ -32,17 +38,18 @@ export default {
poll
,
apiData
:
{},
timeoutId
:
null
,
title
:
'
<span></span>
'
,
title
:
null
,
titleText
:
''
,
description
:
'
<span></span>
'
,
description
:
null
,
descriptionText
:
''
,
descriptionChange
:
false
,
tasks
:
'
0 of 0
'
,
titleEl
:
document
.
querySelector
(
'
title
'
),
};
},
methods
:
{
renderResponse
(
res
)
{
this
.
apiData
=
JSON
.
parse
(
res
.
body
);
this
.
apiData
=
res
.
json
(
);
this
.
triggerAnimation
();
},
updateTaskHTML
()
{
...
...
@@ -53,7 +60,7 @@ export default {
if
(
!
noTitleChange
)
{
this
.
titleText
=
this
.
apiData
.
title_text
;
elementStack
.
push
(
this
.
$
el
.
querySelector
(
'
.title
'
)
);
elementStack
.
push
(
this
.
$
refs
[
'
issue-title
'
]
);
}
if
(
!
noDescriptionChange
)
{
...
...
@@ -61,21 +68,22 @@ export default {
this
.
descriptionChange
=
true
;
this
.
updateTaskHTML
();
this
.
tasks
=
this
.
apiData
.
task_status
;
elementStack
.
push
(
this
.
$
el
.
querySelector
(
'
.wiki
'
)
);
elementStack
.
push
(
this
.
$
refs
[
'
issue-content-container-gfm-entry
'
]
);
}
elementStack
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-pre-pulse
'
);
if
(
element
)
{
element
.
classList
.
remove
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-pre-pulse
'
);
}
});
return
elementStack
;
},
setTabTitle
()
{
const
currentTabTitle
=
document
.
querySelector
(
'
title
'
);
const
currentTabTitleScope
=
currentTabTitle
.
innerText
.
split
(
'
·
'
);
const
currentTabTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
currentTabTitleScope
[
0
]
=
`
${
this
.
titleText
}
(#
${
this
.
apiData
.
issue_number
}
) `
;
currentTabTitle
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
},
animate
(
title
,
description
,
elementsToVisualize
)
{
this
.
timeoutId
=
setTimeout
(()
=>
{
...
...
@@ -84,11 +92,11 @@ export default {
this
.
setTabTitle
();
elementsToVisualize
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
if
(
element
)
{
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
}
});
clearTimeout
(
this
.
timeoutId
);
},
0
);
},
triggerAnimation
()
{
...
...
@@ -163,7 +171,12 @@ export default {
<
template
>
<div>
<h2
class=
"title issue-realtime-trigger-pulse"
v-html=
"title"
></h2>
<h2
class=
"title issue-realtime-trigger-pulse"
ref=
"issue-title"
v-html=
"title"
>
</h2>
<div
:class=
"descriptionClass"
v-if=
"description"
...
...
@@ -174,7 +187,10 @@ export default {
ref=
"issue-content-container-gfm-entry"
>
</div>
<textarea
class=
"hidden js-task-list-field"
v-if=
"descriptionText"
>
{{
descriptionText
}}
</textarea>
<textarea
class=
"hidden js-task-list-field"
v-if=
"descriptionText"
>
{{
descriptionText
}}
</textarea>
</div>
</div>
</
template
>
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