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
4ff5ed14
Commit
4ff5ed14
authored
Jun 18, 2020
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move select2 initialization
parent
9e014dc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
21 deletions
+25
-21
app/assets/javascripts/behaviors/index.js
app/assets/javascripts/behaviors/index.js
+2
-0
app/assets/javascripts/behaviors/select2.js
app/assets/javascripts/behaviors/select2.js
+23
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-21
No files found.
app/assets/javascripts/behaviors/index.js
View file @
4ff5ed14
...
...
@@ -12,6 +12,7 @@ import initPageShortcuts from './shortcuts';
import
'
./toggler_behavior
'
;
import
'
./preview_markdown
'
;
import
initCollapseSidebarOnWindowResize
from
'
./collapse_sidebar_on_window_resize
'
;
import
initSelect2Dropdowns
from
'
./select2
'
;
installGlEmojiElement
();
initGFMInput
();
...
...
@@ -19,3 +20,4 @@ initCopyAsGFM();
initCopyToClipboard
();
initPageShortcuts
();
initCollapseSidebarOnWindowResize
();
initSelect2Dropdowns
();
app/assets/javascripts/behaviors/select2.js
0 → 100644
View file @
4ff5ed14
import
$
from
'
jquery
'
;
export
default
()
=>
{
if
(
$
(
'
select.select2
'
).
length
)
{
import
(
/* webpackChunkName: 'select2' */
'
select2/select2
'
)
.
then
(()
=>
{
$
(
'
select.select2
'
).
select2
({
width
:
'
resolve
'
,
minimumResultsForSearch
:
10
,
dropdownAutoWidth
:
true
,
});
// Close select2 on escape
$
(
'
.js-select2
'
).
on
(
'
select2-close
'
,
()
=>
{
setTimeout
(()
=>
{
$
(
'
.select2-container-active
'
).
removeClass
(
'
select2-container-active
'
);
$
(
'
:focus
'
).
blur
();
},
1
);
});
})
.
catch
(()
=>
{});
}
};
app/assets/javascripts/main.js
View file @
4ff5ed14
...
...
@@ -132,27 +132,6 @@ function deferredInitialisation() {
.
fadeOut
();
});
// Initialize select2 selects
if
(
$
(
'
select.select2
'
).
length
)
{
import
(
/* webpackChunkName: 'select2' */
'
select2/select2
'
)
.
then
(()
=>
{
$
(
'
select.select2
'
).
select2
({
width
:
'
resolve
'
,
minimumResultsForSearch
:
10
,
dropdownAutoWidth
:
true
,
});
// Close select2 on escape
$
(
'
.js-select2
'
).
on
(
'
select2-close
'
,
()
=>
{
setTimeout
(()
=>
{
$
(
'
.select2-container-active
'
).
removeClass
(
'
select2-container-active
'
);
$
(
'
:focus
'
).
blur
();
},
1
);
});
})
.
catch
(()
=>
{});
}
const
glTooltipDelay
=
localStorage
.
getItem
(
'
gl-tooltip-delay
'
);
const
delay
=
glTooltipDelay
?
JSON
.
parse
(
glTooltipDelay
)
:
0
;
...
...
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