summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/firewall_rules_edit.php
diff options
context:
space:
mode:
authorJared Dillard <jared.dillard+github@gmail.com>2016-12-15 11:04:52 -0600
committerRenato Botelho <renato@netgate.com>2016-12-30 09:53:51 -0200
commit744c5ffc5c7fb2eae3ccfcf0f886a92842ec0ae6 (patch)
treee66cec75a1ff8be8fec28d30d48f7967654d2de2 /src/usr/local/www/firewall_rules_edit.php
parentcc20c205f6e7843d834bce8fcbd7867c026287c1 (diff)
downloadpfsense-744c5ffc5c7fb2eae3ccfcf0f886a92842ec0ae6.zip
pfsense-744c5ffc5c7fb2eae3ccfcf0f886a92842ec0ae6.tar.gz
Fix the Safari issue mentioned by @garga
https://github.com/pfsense/pfsense/pull/3139#pullrequestreview-156718 I ended up having to remove the select element and re-create it (along with the options) in order to get around what appears to be a bug in Safari. (cherry picked from commit 9d4da801ebd426db89b515a9d12d3eb389898b62)
Diffstat (limited to 'src/usr/local/www/firewall_rules_edit.php')
-rw-r--r--src/usr/local/www/firewall_rules_edit.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index ede74bd..a7eeee6 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -1931,10 +1931,16 @@ events.push(function() {
var current_sel = ($(listid).val() || ['any']); // Ensures we get correct array when none selected
var new_options = icmptypes[$('#ipprotocol').val()];
var new_html = '';
+ //remove and re-create the select element (otherwise the options can disappear in Safari)
+ $(listid).remove();
+ var select = $("<select></select>").attr("id", "icmptype[]").attr("name", "icmptype[]").addClass("form-control").attr("multiple", "multiple");
+ $('div.icmptype_section > div.col-sm-10').prepend(select);
+
for (var key in new_options) {
new_html += '<option value="' + key + (jQuery.inArray(key, current_sel) != -1 ? '" selected="selected">' : '">') + new_options[key] + '</option>\n';
}
- $(listid).empty().html(new_html);
+
+ $(listid).html(new_html);
ext_change();
OpenPOWER on IntegriCloud