mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Add Javascript feature detection for oninput
This commit adds a feature detection for the `oninput` event, which isn’t supported in older browsers[1]. This means that the code that highlights placeholders will only be run in browsers that support the `oninput` event. 1. http://caniuse.com/#feat=input-event
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
(function(Modules) {
|
(function(Modules) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
if (
|
||||||
|
!('oninput' in document.createElement('input'))
|
||||||
|
) return;
|
||||||
|
|
||||||
const tagPattern = /\(\([^\)\(]+\)\)/g;
|
const tagPattern = /\(\([^\)\(]+\)\)/g;
|
||||||
|
|
||||||
Modules.HighlightTags = function() {
|
Modules.HighlightTags = function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user