Skip to content

Commit

Permalink
Use https for autocomplete in search on https pages. Changed z-index …
Browse files Browse the repository at this point in the history
…for autcomplete
  • Loading branch information
martent committed Oct 23, 2013
1 parent 11d5819 commit 5dcc150
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/assets/content/masthead.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<div id="masthead-search" class="malmo-form">
<form action="<%= APP_CONFIG['site_search_url'] %>" method="get" id="masthead-search-intranet">
<div class="input-append">
<input name="q" class="q" placeholder="Ett eller flera sökord" type="text" data-autocomplete-path="<%= APP_CONFIG['site_search_url'] %>/autocomplete" />
<input name="q" class="q" placeholder="Ett eller flera sökord" type="text" data-autocomplete-url="<%= APP_CONFIG['site_search_url'] %>/autocomplete" />
<input class="btn btn-primary" name="search-intranet" type="submit" value="Sök på Komin"/>
</div>
</form>
Expand Down
10 changes: 5 additions & 5 deletions app/assets/javascripts/masthead.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jQuery ($) ->
$searchField.autocomplete
source: (request, response) ->
$.ajax
url: $searchField.attr("data-autocomplete-path")
url: $searchField.attr("data-autocomplete-url").replace("http:", location.protocol)
data:
q: request.term
ilang: 'sv'
Expand All @@ -135,9 +135,9 @@ jQuery ($) ->
minLength: 2
select: (event, ui) ->
document.location = $("#masthead-search-intranet").attr('action') + '?q=' + unescape(ui.item.value)
.css("z-index", 101)
.data( "ui-autocomplete" )._renderItem = (ul, item) ->
ul.css("z-index", 1000)
return $("<li></li>")
.data("ui-autocomplete-item", item)
.append("<a><span class='hits'>" + item.hits + "</span>" + item.suggestionHighlighted + "</a>")
.appendTo(ul)
.data("ui-autocomplete-item", item)
.append("<a><span class='hits'>" + item.hits + "</span>" + item.suggestionHighlighted + "</a>")
.appendTo(ul)
4 changes: 2 additions & 2 deletions app/assets/javascripts/masthead_content.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5dcc150

Please sign in to comment.