Sha256: e5a38060272e08e1a5e5f971119dfa8881f3c5319f37e07cae3ea07af3b95fdd

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

<% params[:name] ||= 'looking_for_window' %>
var window_id = "<%= params[:name] %>";

<% if params[:validate] == 'true' %>
  <% if !params[:fill].nil? %>
    <% params[:fill].each do |key, value| %>
      $("#<%= value %>").val("");     
    <% end %>        
  <% end %>
<% end %>

if ($("#"+window_id).length == 0)
{
  var p_width  = <%= params[:width]  || 500  %>;
  var p_height = <%= params[:height] || 300  %>;
  $("<div id='"+window_id+"'></div>").dialog({autoOpen: true,title: 'Looking for..',height: p_height,width: p_width,modal: true, close: function(ev, ui) {$(this).remove();}});
  $("#"+window_id).html("<%= escape_javascript(render('looking_for')) %>");
  $("#"+window_id).effect('slide');
}

$("#"+window_id).dialog('open');
$("#looking_for-toolbar").html("<%= escape_javascript(render('toolbar')) %>");
$("#looking_for-results").html("<%= escape_javascript(render('results')) %>");
$("#looking_for-pagination").html("<%= escape_javascript(render('pagination')) %>");

$("#looking_for_prev").button({text: false,  icons: { primary: "ui-icon-seek-prev"}});
$("#looking_for_next").button({text: false,  icons: { primary: "ui-icon-seek-next"}});
$("#looking_for_find").button({text: false,  icons: { primary: "ui-icon-search"}});
    
$('#looking_for_prev').click
(
  function() 
  {
    $('#looking_for_form input[name=page]').val(parseInt($('#looking_for_form input[name=page]').val())-1);
    $('#looking_for_form').submit();
  }
);

$('#looking_for_find').click
(
  function() 
  {
    $('#looking_for_form input[name=page]').val(1);  
    $('#looking_for_form').submit();
  }
);

$('#looking_for_next').click
(
  function() 
  { 
    $('#looking_for_form input[name=page]').val(parseInt($('#looking_for_form input[name=page]').val())+1);  
    $('#looking_for_form').submit();
  }
);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
looking_for-0.2.0 app/views/looking_for/looking_for.js.erb