Sha256: ba83c261367ab996f7675bb7c0c803fb9bdf257b963f164e0d0b09c6ddf9c445

Contents?: true

Size: 1.64 KB

Versions: 2

Compression:

Stored size: 1.64 KB

Contents

function hoverDetailReports() {
  $("#reports table tbody tr").click(function(){
      $.getScript('/reports/'+$(this).attr('rel')+'.js');
      $("#reports table tbody tr").removeClass('highlight');
      $(this).addClass("highlight");
  });
}
function updateColumnsEditor () {
  $('#columns ul').empty();
 $('#columns_editor input:checked').each(function(index) {
   $('#columns ul').append("<li>"+ $(this).val()+"</li>");
 });
}
function updateOptions (dialogType) {
  switch(dialogType) {
    case '#columns_editor' :
      updateColumnsEditor();
      break;
    //case '#sorts_editor':
    //  // code
    //case '#filters_editor':
    //  // code
    //case '#schedule_editor':
      // code
  }
}
function toggleWithin (parentSelector, child) {
 $(parentSelector + ' > * ').not(':last').hide();
 $(child).slideDown();
}
function reporterEditor () {
  $("[rel^='toggle_within']").click( function () {
    within = $(this).attr('rel').split('/')[1];
    toggleWithin(within, $(this).attr('href'));
  });
  $("#editors > div > button").click(function () {
      editor = $(this).closest("[id$='_editor']").attr('id');
      $('#'+editor).slideUp();
      if ($(this).text() == 'Ok') { updateOptions('#'+editor); };
      return false;
      });
}

function dialogs() {
  $('a.local_dialog').live('click', function () {
    var dialogId = $(this).attr('href');
    $(dialogId).dialog({
      buttons : {
				Ok : function() {
          updateOptions(dialogId)
					$( this ).dialog( "close" );
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				} 
      }});
  })
}
$(document).ready( function() {
   hoverDetailReports();
   dialogs();
   reporterEditor();
})

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
report_ui-0.0.1.alpha public/javascripts/application.js
report_ui-0.0.1.alpha public/javascripts/report_ui/application.js