Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
Moving slowly and fixing things

Paul Robert Lloyd paulrobertlloyd

🐢
Moving slowly and fixing things
View GitHub Profile
@paulrobertlloyd
paulrobertlloyd / gist:8189506
Last active Jan 1, 2016
grunt-contrib-uglify is borking my JavaScript. What am I doing wrong?
View gist:8189506
/**
* Before grunt-contrib-uglify
*/
(function(doc) {
if (document.querySelector) {
var toggleClassName = function(element, toggleClass) {
var reg = new RegExp('(\\s|^)' + toggleClass + '(\\s|$)');
if (!element.className.match(reg)) {
element.className += ' ' + toggleClass;
} else {