Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jun 25, 2010
1 parent fd14001 commit 58b6b9f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions public/javascripts/form.js
Expand Up @@ -28,21 +28,19 @@ $(document).ready(function() {
});

$("a.display_form").live("click",function(event) {
var link = $(this);
var id_attribute_name = link.attr('id').split('_');
var title_array = link.text().split(' ');
var link = $(this),
id_attribute_name = link.attr('id').split('_'),
title_array = link.text().split(' '),
prefix = '';

$('form').toggle(function() {
if('view' == link.text().substr(0,4)) {
link.text('hide ' + title_array[1]);
} else {
link.text('view ' + title_array[1]);
}
prefix = ('view' == link.text().substr(0,4))? 'hide ' : 'view ';
link.text(prefix + title_array[1]);
});
});

// Disable autocomplete for our imput elements
$('input').attr('autocomplete','off');

$('fieldset.views').hide();
$('fieldset.inputs > ol li').generateFormatasticTooltips();
});

0 comments on commit 58b6b9f

Please sign in to comment.