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
iv
gitlab-ce
Commits
92f04733
Commit
92f04733
authored
May 02, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move search autocomplete call to dispatcher
parent
0b981eb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
11 deletions
+21
-11
app/assets/javascripts/admin.js.coffee
app/assets/javascripts/admin.js.coffee
+4
-2
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+8
-1
app/assets/javascripts/search_autocomplete.js.coffee
app/assets/javascripts/search_autocomplete.js.coffee
+8
-0
app/views/layouts/_search.html.haml
app/views/layouts/_search.html.haml
+1
-8
No files found.
app/assets/javascripts/admin.js.coffee
View file @
92f04733
@
Admin
=
class
Admin
init
:
->
constructor
:
->
$
(
'input#user_force_random_password'
).
on
'change'
,
(
elem
)
->
$
(
'input#user_force_random_password'
).
on
'change'
,
(
elem
)
->
elems
=
$
(
'#user_password, #user_password_confirmation'
)
elems
=
$
(
'#user_password, #user_password_confirmation'
)
...
@@ -26,3 +26,5 @@
...
@@ -26,3 +26,5 @@
$
(
'.change-owner-cancel-link'
).
bind
"click"
,
->
$
(
'.change-owner-cancel-link'
).
bind
"click"
,
->
modal
.
hide
()
modal
.
hide
()
$
(
'.change-owner-link'
).
show
()
$
(
'.change-owner-link'
).
show
()
@
Admin
=
Admin
app/assets/javascripts/dispatcher.js.coffee
View file @
92f04733
...
@@ -3,6 +3,10 @@ $ ->
...
@@ -3,6 +3,10 @@ $ ->
class
Dispatcher
class
Dispatcher
constructor
:
()
->
constructor
:
()
->
@
initSearch
()
@
initPageScripts
()
initPageScripts
:
->
page
=
$
(
'body'
).
attr
(
'data-page'
)
page
=
$
(
'body'
).
attr
(
'data-page'
)
project_id
=
$
(
'body'
).
attr
(
'data-project-id'
)
project_id
=
$
(
'body'
).
attr
(
'data-project-id'
)
...
@@ -25,6 +29,9 @@ class Dispatcher
...
@@ -25,6 +29,9 @@ class Dispatcher
new
Wall
(
project_id
)
new
Wall
(
project_id
)
switch
path
.
first
()
switch
path
.
first
()
when
'admin'
then
Admin
.
init
()
when
'admin'
then
new
Admin
()
when
'wikis'
then
new
Wikis
()
when
'wikis'
then
new
Wikis
()
initSearch
:
->
autocomplete_json
=
$
(
'.search-autocomplete-json'
).
data
(
'autocomplete-opts'
)
new
SearchAutocomplete
(
autocomplete_json
)
app/assets/javascripts/search_autocomplete.js.coffee
0 → 100644
View file @
92f04733
class
SearchAutocomplete
constructor
:
(
json
)
->
$
(
"#search"
).
autocomplete
source
:
json
select
:
(
event
,
ui
)
->
location
.
href
=
ui
.
item
.
url
@
SearchAutocomplete
=
SearchAutocomplete
app/views/layouts/_search.html.haml
View file @
92f04733
...
@@ -3,11 +3,4 @@
...
@@ -3,11 +3,4 @@
=
text_field_tag
"search"
,
nil
,
placeholder:
"Search"
,
class:
"search-input"
=
text_field_tag
"search"
,
nil
,
placeholder:
"Search"
,
class:
"search-input"
=
hidden_field_tag
:group_id
,
@group
.
try
(
:id
)
=
hidden_field_tag
:group_id
,
@group
.
try
(
:id
)
=
hidden_field_tag
:project_id
,
@project
.
try
(
:id
)
=
hidden_field_tag
:project_id
,
@project
.
try
(
:id
)
.search-autocomplete-json.hide
{
:'data-autocomplete-opts'
=>
search_autocomplete_source
}
:javascript
$
(
function
(){
$
(
"
#search
"
).
autocomplete
({
source
:
#{
raw
search_autocomplete_source
}
,
select
:
function
(
event
,
ui
)
{
location
.
href
=
ui
.
item
.
url
}
});
});
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