<% content_for :heading do -%><%= t('myplaceonline.passwords.title') %><% end -%>
<h1><%= t('myplaceonline.passwords.title') %></h1>
<%= flashes! %>

<%
if @passwords.length == 0
%>
<p><%= t('myplaceonline.passwords.none') %></p>
<%
else
%>
<ul data-role="listview" data-inset="true" data-filter="true">
<%
  @passwords.each do |password|
%>
  <li>
    <%= link_to password.name, password %>
  </li>
<%
  end
%>
</ul>
<%
end
%>

<% content_for :footer do -%>
<div data-role="footer" data-position="fixed">
    <div data-role="navbar">
        <ul>
            <li><%= link_to t('myplaceonline.passwords.title_add'), new_password_path, "data-icon" => "plus" %></li>
            <li><a href="#" data-icon="bars">Import</a></li>
        </ul>
    </div>
</div>
<% end -%>
<% content_for :heading do -%><%= t('myplaceonline.passwords.title') %><% end -%>
<h1><%= t('myplaceonline.passwords.title') %></h1>
<%= flashes! %>

<%
if @passwords.length == 0
%>
<p><%= t('myplaceonline.passwords.none') %></p>
<%
else
%>
<div class="searchable_container">
  <ul class="searchable" data-role="listview" data-inset="true" data-filter="true">
<%
    @passwords.each do |password|
%>
    <li>
      <%= link_to password.name, password %>
    </li>
<%
    end
%>
  </ul>
</div>
<%
end
%>

<script type="text/javascript">
onPageLoad(function() {

  var input = $(".searchable_container input");
  
  input.keyup(function(e) {
    if(e.which == 13) {
      var searchList = $(".searchable li:not(.ui-screen-hidden)");
      if (searchList.size() > 0) {
        e.preventDefault();
        navigate(searchList.filter(":first").children("a").attr("href"));
      }
    }
    return true;
  });

  input.focus();
  
});
</script>

<% content_for :footer do -%>
<div data-role="footer" data-position="fixed">
    <div data-role="navbar">
        <ul>
            <li><%= link_to t('myplaceonline.passwords.title_add'), new_password_path, "data-icon" => "plus" %></li>
            <li><a href="#" data-icon="bars">Import</a></li>
        </ul>
    </div>
</div>
<% end -%>
Add ENTER support to passwords list
Add ENTER support to passwords list
