// Responsive breadcrumbs
// http://codepen.io/bradfrost/pen/DCgax
// No need to thouch this block of code, only the initialisation line below
var ResponsiveBreadcrumbs = {
	addListener: function(element, eventName, handler) {
		if (element.addEventListener) {
			element.addEventListener(eventName, handler, false);
		}
		else if (element.attachEvent) {
			element.attachEvent('on' + eventName, handler);
		}
		else {
			element['on' + eventName] = handler;
		}
	},

	hasClass: function (elem, className) {
    	return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
    },

    addClass: function(elem, className) {
	    if (!hasClass(elem, className)) {
	        elem.className += ' ' + className;
	    }
	},

    toggleClass: function(elem, className) {
	    var newClass = ' ' + elem.className.replace( /[\t\r\n]/g, ' ' ) + ' ';

	    if (hasClass(elem, className)) {
	        while (newClass.indexOf(' ' + className + ' ') >= 0 ) {
	            newClass = newClass.replace( ' ' + className + ' ' , ' ' );
	        }

	        elem.className = newClass.replace(/^\s+|\s+$/g, '');
	    } 
	    else {
	        elem.className += ' ' + className;
	    }
	},

	init: function(crumbsContainerSelector, activeClassName) {
		var breadCrumbsContainer = document.querySelector(crumbsContainerSelector);

		var crumbsTrigger = document.createElement("a");
		crumbsTrigger.setAttribute("id", "crumbs-trigger");
		crumbsTrigger.setAttribute("href", "#");

		breadCrumbsContainer.appendChild(crumbsTrigger);

		this.addListener(document.querySelector("#crumbs-trigger"), "click", function(event) {
			event.preventDefault();

			ResponsiveBreadcrumbs.toggleClass(breadCrumbsContainer, activeClassName);

			if (ResponsiveBreadcrumbs.hasClass(breadCrumbsContainer, activeClassName)) {
				// $this.text('-');
				var minusText = document.createTextNode("-");
				this.replaceChild(minusText, this.childNodes[0]);
			}
			else {
				// $this.text('+');
				var plusText = document.createTextNode("+");
				this.replaceChild(plusText, this.childNodes[0]);
			}
		});
	}
};

// START HERE!!
window.onload = function() {
	// Here is where you need to edit. Arguments are as follows:
	// crumbsContainerSelector - The container item (if it is referenced by ID, prefix with "#". Classes require a ".")
	// activeClassName - The class name to toggle on/off when the container is in small-screen mode
	//
	// Example:
	// ResponsiveBreadcrumbs.init(crumbsContainerSelector, activeClassName);

	ResponsiveBreadcrumbs.init(".crumbs-container", "active");
};
@@ -501,20 +501,17 @@
 Name) %7B%0A
-    
+%09
 %09return 
@@ -582,20 +582,14 @@
 ');%0A
-    %7D,%0A%0A    
+%09%7D,%0A%0A%09
 addC
@@ -627,17 +627,36 @@
  %7B%0A%09
-    
+%09
 if (!
+ResponsiveBreadcrumbs.
 hasC
@@ -677,32 +677,26 @@
 ssName)) %7B%0A%09
-        
+%09%09
 elem.classNa
@@ -723,23 +723,17 @@
 e;%0A%09
-    
+%09
 %7D%0A%09%7D,%0A%0A
-    
+%09
 togg
@@ -770,20 +770,17 @@
 ame) %7B%0A%09
-    
+%09
 var newC
@@ -848,16 +848,35 @@
 ;%0A%0A%09
-    if (
+%09if (ResponsiveBreadcrumbs.
 hasC
@@ -901,24 +901,18 @@
 me)) %7B%0A%09
-        
+%09%09
 while (n
@@ -964,20 +964,11 @@
  %7B%0A%09
-            
+%09%09%09
 newC
@@ -1028,28 +1028,16 @@
 );%0A%09
-        %7D%0A%0A%09        
+%09%09%7D%0A%0A%09%09%09
 elem
@@ -1090,36 +1090,23 @@
 );%0A%09
-    %7D %0A%09    else %7B%0A%09        
+%09%7D%0A%09%09else %7B%0A%09%09%09
 elem
@@ -1141,12 +1141,9 @@
 e;%0A%09
-    
+%09
 %7D%0A%09%7D
@@ -1431,16 +1431,75 @@
 %22, %22#%22);
+%0A%09%09crumbsTrigger.appendChild(document.createTextNode(%22+%22));
 %0A%0A%09%09brea
@@ -1827,109 +1827,54 @@
 %09%09%09%09
-// $
 this.
-text('-');%0A%09%09%09%09var minusText = document.createTextNode(%22-%22);%0A%09%09%09%09this.replaceChild(minusText
+replaceChild(document.createTextNode(%22-%22)
 , th
@@ -1915,107 +1915,54 @@
 %09%09%09%09
-// $
 this.
-text('+');%0A%09%09%09%09var plusText = document.createTextNode(%22+%22);%0A%09%09%09%09this.replaceChild(plusText
+replaceChild(document.createTextNode(%22+%22)
 , th
@@ -2043,17 +2043,16 @@
 ion() %7B%0A
-%09
 // Here 
@@ -2104,17 +2104,16 @@
 ollows:%0A
-%09
 // crumb
@@ -2220,17 +2220,16 @@
  a %22.%22)%0A
-%09
 // activ
@@ -2320,13 +2320,11 @@
 ode%0A
-%09
 //%0A
-%09
 // E
@@ -2331,17 +2331,16 @@
 xample:%0A
-%09
 // Respo
@@ -2467,8 +2467,9 @@
 ve%22);%0A%7D;
+%0A

Fix non-jQuery responsive breadcrumb