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
2925fc96
Commit
2925fc96
authored
Mar 14, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete unused file
parent
d38ef7b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
49 deletions
+0
-49
app/assets/javascripts/lib/category_autocomplete.js.coffee
app/assets/javascripts/lib/category_autocomplete.js.coffee
+0
-49
No files found.
app/assets/javascripts/lib/category_autocomplete.js.coffee
deleted
100644 → 0
View file @
d38ef7b5
$
.
widget
(
"custom.catcomplete"
,
$
.
ui
.
autocomplete
,
_create
:
->
@
_super
();
@
widget
().
menu
(
"option"
,
"items"
,
"> :not(.ui-autocomplete-category)"
)
_renderMenu
:
(
ul
,
items
)
->
currentCategory
=
''
$
.
each
items
,
(
index
,
item
)
=>
if
item
.
category
isnt
currentCategory
ul
.
append
(
"<li class='ui-autocomplete-category'>
#{
item
.
category
}
</li>"
)
currentCategory
=
item
.
category
li
=
@
_renderItemData
(
ul
,
item
)
if
item
.
category
?
li
.
attr
(
'aria-label'
,
item
.
category
+
" : "
+
item
.
label
)
_renderItem
:
(
ul
,
item
)
->
# Highlight occurrences
item
.
label
=
item
.
label
.
replace
(
new
RegExp
(
"(?![^&;]+;)(?!<[^<>]*)("
+
$
.
ui
.
autocomplete
.
escapeRegex
(
this
.
term
)
+
")(?![^<>]*>)(?![^&;]+;)"
,
"gi"
),
"<strong>$1</strong>"
);
return
$
(
"<li></li>"
)
.
data
(
"item.autocomplete"
,
item
)
.
append
(
"<a>
#{
item
.
label
}
</a>"
)
.
appendTo
(
ul
);
_resizeMenu
:
->
if
(
isNaN
(
this
.
options
.
maxShowItems
))
return
ul
=
this
.
menu
.
element
.
css
(
overflowX
:
''
,
overflowY
:
''
,
width
:
''
,
maxHeight
:
''
)
lis
=
ul
.
children
(
'li'
).
css
(
'whiteSpace'
,
'nowrap'
);
if
(
lis
.
length
>
this
.
options
.
maxShowItems
)
ulW
=
ul
.
prop
(
'clientWidth'
)
ul
.
css
(
overflowX
:
'hidden'
overflowY
:
'auto'
maxHeight
:
lis
.
eq
(
0
).
outerHeight
()
*
this
.
options
.
maxShowItems
+
1
)
barW
=
ulW
-
ul
.
prop
(
'clientWidth'
);
ul
.
width
(
'+='
+
barW
);
# Original code from jquery.ui.autocomplete.js _resizeMenu()
ul
.
outerWidth
(
Math
.
max
(
ul
.
outerWidth
()
+
1
,
this
.
element
.
outerWidth
()));
)
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