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:
Chris Hill-Scott
2015-12-20 00:00:01 +00:00
parent 74da3b1adf
commit 84cdd2f4f0

View File

@@ -1,6 +1,10 @@
(function(Modules) {
"use strict";
if (
!('oninput' in document.createElement('input'))
) return;
const tagPattern = /\(\([^\)\(]+\)\)/g;
Modules.HighlightTags = function() {