Bug 38661: (follow-up) Eliminate duplicate ids
The id attribute should be unique on the page, so I'm changing it to a
name attribute and updating the corresonding selector.
Also, we can eliminate find() here:
$(this).closest('form').find('input...
...because $(this) IS the form, so we can optimize a tiny bit by
removing the find().
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit eef4683e9a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
65caca0ba8
commit
482b91881c
|
|
@ -388,7 +388,7 @@
|
|||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id | html %]" />
|
||||
<input type="hidden" name="op" value="cud-clean-batch" />
|
||||
<input type="hidden" id="import_status" value="[% batch_lis.import_status | html %]" />
|
||||
<input type="hidden" name="import_status" value="[% batch_lis.import_status | html %]" />
|
||||
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-eraser"></i> Clean</button>
|
||||
</form>
|
||||
[% ELSIF ( batch_lis.import_status == 'cleaned' ) %]
|
||||
|
|
@ -635,12 +635,12 @@
|
|||
if ($(this).hasClass("batch_delete")) {
|
||||
return confirm(_("Are you sure you want to permanently delete this batch?"));
|
||||
} else {
|
||||
if ($(this).closest('form').find('input#import_status').val() === "imported" ) {
|
||||
if ($(this).find("input[name='import_status']").val() === "imported" ) {
|
||||
return confirm(_("This batch contains imported records. Are you sure you wish to clear all the reservoir records? This cannot be undone."));
|
||||
} else {
|
||||
return confirm(_("Clear all reservoir records staged in this batch? This cannot be undone."));
|
||||
return confirm(_("Clear all reservoir records staged in this batch? This cannot be undone."));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
[% IF job_enqueued %]
|
||||
setTimeout(
|
||||
|
|
|
|||
Loading…
Reference in New Issue