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
19967472
Commit
19967472
authored
Dec 22, 2016
by
Nur Rony
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trucates text to prevent overflow and adds tooltip to it
parent
5bfce8e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
app/assets/javascripts/compare_autocomplete.js.es6
app/assets/javascripts/compare_autocomplete.js.es6
+8
-0
app/views/projects/compare/_form.html.haml
app/views/projects/compare/_form.html.haml
+4
-4
No files found.
app/assets/javascripts/compare_autocomplete.js.es6
View file @
19967472
...
@@ -55,6 +55,14 @@
...
@@ -55,6 +55,14 @@
$('.dropdown-toggle-text', $dropdown).text(text);
$('.dropdown-toggle-text', $dropdown).text(text);
$dropdownContainer.removeClass('open');
$dropdownContainer.removeClass('open');
});
});
$dropdownContainer.on('click' , '.dropdown-content a', (e) => {
$dropdown.prop('title', e.target.text.replace(/_+?/g,'-'));
if ($dropdown.hasClass('has-tooltip')) {
$dropdown.tooltip('fixTitle');
}
})
});
});
};
};
...
...
app/views/projects/compare/_form.html.haml
View file @
19967472
...
@@ -7,16 +7,16 @@
...
@@ -7,16 +7,16 @@
.input-group.inline-input-group
.input-group.inline-input-group
%span
.input-group-addon
from
%span
.input-group-addon
from
=
hidden_field_tag
:from
,
params
[
:from
]
=
hidden_field_tag
:from
,
params
[
:from
]
=
button_tag
type:
'button'
,
class:
"form-control compare-dropdown-toggle js-compare-dropdown
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-from-dropdown"
,
selected:
params
[
:from
],
field_name: :from
}
do
=
button_tag
type:
'button'
,
title:
params
[
:from
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-from-dropdown"
,
selected:
params
[
:from
],
field_name: :from
}
do
.dropdown-toggle-text
=
params
[
:from
]
||
'Select branch/tag'
.dropdown-toggle-text
.str-truncated
=
params
[
:from
]
||
'Select branch/tag'
=
render
"ref_dropdown"
=
render
"ref_dropdown"
.compare-ellipsis.inline
...
.compare-ellipsis.inline
...
.form-group.dropdown.compare-form-group.to.js-compare-to-dropdown
.form-group.dropdown.compare-form-group.to.js-compare-to-dropdown
.input-group.inline-input-group
.input-group.inline-input-group
%span
.input-group-addon
to
%span
.input-group-addon
to
=
hidden_field_tag
:to
,
params
[
:to
]
=
hidden_field_tag
:to
,
params
[
:to
]
=
button_tag
type:
'button'
,
class:
"form-control compare-dropdown-toggle js-compare-dropdown
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-to-dropdown"
,
selected:
params
[
:to
],
field_name: :to
}
do
=
button_tag
type:
'button'
,
title:
params
[
:to
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-to-dropdown"
,
selected:
params
[
:to
],
field_name: :to
}
do
.dropdown-toggle-text
=
params
[
:to
]
||
'Select branch/tag'
.dropdown-toggle-text
.str-truncated
=
params
[
:to
]
||
'Select branch/tag'
=
render
"ref_dropdown"
=
render
"ref_dropdown"
=
button_tag
"Compare"
,
class:
"btn btn-create commits-compare-btn"
=
button_tag
"Compare"
,
class:
"btn btn-create commits-compare-btn"
...
...
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