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
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';
...
@@ -6,8 +6,14 @@ import tasks from './actions/tasks';
export
default
{
export
default
{
props
:
{
props
:
{
endpoint
:
{
required
:
true
,
type
:
String
},
endpoint
:
{
candescription
:
{
required
:
true
,
type
:
String
},
required
:
true
,
type
:
String
,
},
candescription
:
{
required
:
true
,
type
:
String
,
},
},
},
data
()
{
data
()
{
const
resource
=
new
Service
(
this
.
$http
,
this
.
endpoint
);
const
resource
=
new
Service
(
this
.
$http
,
this
.
endpoint
);
...
@@ -32,17 +38,18 @@ export default {
...
@@ -32,17 +38,18 @@ export default {
poll
,
poll
,
apiData
:
{},
apiData
:
{},
timeoutId
:
null
,
timeoutId
:
null
,
title
:
'
<span></span>
'
,
title
:
null
,
titleText
:
''
,
titleText
:
''
,
description
:
'
<span></span>
'
,
description
:
null
,
descriptionText
:
''
,
descriptionText
:
''
,
descriptionChange
:
false
,
descriptionChange
:
false
,
tasks
:
'
0 of 0
'
,
tasks
:
'
0 of 0
'
,
titleEl
:
document
.
querySelector
(
'
title
'
),
};
};
},
},
methods
:
{
methods
:
{
renderResponse
(
res
)
{
renderResponse
(
res
)
{
this
.
apiData
=
JSON
.
parse
(
res
.
body
);
this
.
apiData
=
res
.
json
(
);
this
.
triggerAnimation
();
this
.
triggerAnimation
();
},
},
updateTaskHTML
()
{
updateTaskHTML
()
{
...
@@ -53,7 +60,7 @@ export default {
...
@@ -53,7 +60,7 @@ export default {
if
(
!
noTitleChange
)
{
if
(
!
noTitleChange
)
{
this
.
titleText
=
this
.
apiData
.
title_text
;
this
.
titleText
=
this
.
apiData
.
title_text
;
elementStack
.
push
(
this
.
$
el
.
querySelector
(
'
.title
'
)
);
elementStack
.
push
(
this
.
$
refs
[
'
issue-title
'
]
);
}
}
if
(
!
noDescriptionChange
)
{
if
(
!
noDescriptionChange
)
{
...
@@ -61,21 +68,22 @@ export default {
...
@@ -61,21 +68,22 @@ 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
.
$
el
.
querySelector
(
'
.wiki
'
)
);
elementStack
.
push
(
this
.
$
refs
[
'
issue-content-container-gfm-entry
'
]
);
}
}
elementStack
.
forEach
((
element
)
=>
{
elementStack
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'
issue-realtime-trigger-pulse
'
);
if
(
element
)
{
element
.
classList
.
add
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
remove
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-pre-pulse
'
);
}
});
});
return
elementStack
;
return
elementStack
;
},
},
setTabTitle
()
{
setTabTitle
()
{
const
currentTabTitle
=
document
.
querySelector
(
'
title
'
);
const
currentTabTitleScope
=
this
.
titleEl
.
innerText
.
split
(
'
·
'
);
const
currentTabTitleScope
=
currentTabTitle
.
innerText
.
split
(
'
·
'
);
currentTabTitleScope
[
0
]
=
`
${
this
.
titleText
}
(#
${
this
.
apiData
.
issue_number
}
) `
;
currentTabTitleScope
[
0
]
=
`
${
this
.
titleText
}
(#
${
this
.
apiData
.
issue_number
}
) `
;
currentTabTitle
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
this
.
titleEl
.
innerText
=
currentTabTitleScope
.
join
(
'
·
'
);
},
},
animate
(
title
,
description
,
elementsToVisualize
)
{
animate
(
title
,
description
,
elementsToVisualize
)
{
this
.
timeoutId
=
setTimeout
(()
=>
{
this
.
timeoutId
=
setTimeout
(()
=>
{
...
@@ -84,11 +92,11 @@ export default {
...
@@ -84,11 +92,11 @@ export default {
this
.
setTabTitle
();
this
.
setTabTitle
();
elementsToVisualize
.
forEach
((
element
)
=>
{
elementsToVisualize
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
if
(
element
)
{
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
element
.
classList
.
remove
(
'
issue-realtime-pre-pulse
'
);
element
.
classList
.
add
(
'
issue-realtime-trigger-pulse
'
);
}
});
});
clearTimeout
(
this
.
timeoutId
);
},
0
);
},
0
);
},
},
triggerAnimation
()
{
triggerAnimation
()
{
...
@@ -163,7 +171,12 @@ export default {
...
@@ -163,7 +171,12 @@ export default {
<
template
>
<
template
>
<div>
<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
<div
:class=
"descriptionClass"
:class=
"descriptionClass"
v-if=
"description"
v-if=
"description"
...
@@ -174,7 +187,10 @@ export default {
...
@@ -174,7 +187,10 @@ export default {
ref=
"issue-content-container-gfm-entry"
ref=
"issue-content-container-gfm-entry"
>
>
</div>
</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>
</div>
</div>
</
template
>
</
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