From 0ff5d1eddee7c0984ee0ba8e29603b96ae698f99 Mon Sep 17 00:00:00 2001 From: Oskari Porkka Date: Tue, 12 Jul 2016 10:48:35 +0200 Subject: [PATCH] Fix enum plugin to be standard compatible The word `enum` is is a reserved JavaScript word and form $.fn.dataTable.enum broke at least YuiCompressor minification --- sorting/enum.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sorting/enum.js b/sorting/enum.js index 7b5e869..9aa888f 100644 --- a/sorting/enum.js +++ b/sorting/enum.js @@ -24,7 +24,9 @@ var unique = 0; var types = $.fn.dataTable.ext.type; -$.fn.dataTable.enum = function ( arr ) { +// Using form $.fn.dataTable.enum breaks at least YuiCompressor since enum is +// a reserved word in JavaScript +$.fn.dataTable['enum'] = function ( arr ) { var name = 'enum-'+(unique++); var lookup = window.Map ? new Map() : {};