Skip to content

Commit 6d16d1d

Browse files
committed
Support to "unset" even if one radio is checked
Previously we used jquery-uncheckable-radio to uncheck radios, which has been broken for a long while. By adding an empty-value radio option along with Incident's text input, checking it not only indicates that user's manual input will be used, but also automatically unchecks previously checked radio input.
1 parent 0d82c17 commit 6d16d1d

3 files changed

Lines changed: 6 additions & 81 deletions

File tree

html/RTIR/Elements/SelectIncident

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
<input type="hidden" name="<% $Name %>" value="<% $potential[0] %>" />
6262
% }
6363

64+
% if ( $dformat =~ /RadioButton/ ) {
65+
<div class="col-auto mt-1">
66+
<input type="radio" name="Incident" value="" class="form-check-input mt-2" />
67+
</div>
68+
% }
69+
6470
<div class="col-auto">
6571
<input class="form-control" type="text" name="<% $Name %>" value="" data-autocomplete="Tickets" data-autocomplete-limit="Lifecycle = 'incidents'" />
6672
</div>
@@ -69,14 +75,6 @@
6975
<input type="submit" name="<% "More$Name" %>" value="<% $config->{'Multiple'}? loc('Add') : loc('Other') %>" class="btn btn-primary" />
7076
</div>
7177
% }
72-
73-
% if ( !$config->{'Required'} && $dformat =~ /RadioButton/ ) {
74-
<script type="text/javascript">
75-
//<![CDATA[
76-
jQuery(function(){ jQuery('input[type="radio"][name="<% $Name %>"]').uncheckable() });
77-
//]]>
78-
</script>
79-
% }
8078
</div>
8179
<%ARGS>
8280
$Type

lib/RT/IR.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ for my $result_page ( 'Link/FromIncident/', 'Link/ToIncident/', 'Merge/', 'Incid
142142
use Parse::BooleanLogic;
143143
my $ticket_sql_parser = Parse::BooleanLogic->new;
144144

145-
RT->AddJavaScript('jquery.uncheckable-radio-0.1.js');
146145
RT->AddStyleSheets( 'rtir-styles.css' );
147146

148147
# Add the RTIR search result page to the whitelist to allow

static/js/jquery.uncheckable-radio-0.1.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)