Fix the 'add' button

THe Add button was located using the DOm, and the scheme used to find it was fragile enough to be broken by the I18N approach.  This is a little more robust, using a JQuery selector based on the class of the controls, and the entity name.

Also remove  Makefile, which should be autogenerated
This commit is contained in:
Adam Young
2010-09-28 08:20:16 -04:00
parent d966056bb0
commit b3a501b8da
2 changed files with 7 additions and 289 deletions

View File

@@ -75,9 +75,13 @@ function ipa_entity_setup(jobj)
function setup_search_facet() {
var filter = $.bbq.getState(obj_name + '-filter', true);
search_create(obj_name, ipa_entity_search_list[obj_name], jobj);
var input = jobj.find('input[value=find]');
input.after('<input type="submit" value="new" />');
input.next().click(new_on_click);
$('<input />',{
type:"submit",
value: ipa_messages.button.add,
click:new_on_click
}).appendTo($( "div#" + obj_name + " > div.search-controls"));
if (typeof filter != 'undefined')
search_load(obj_name, filter, null, null);
};