
function moveToC(){
    var viewportWidth = $(window).width();
    if (viewportWidth < 1000) {
        $('.toc').appendTo($('.toc-sidebar'));
    } else {
        $('.ui.sidebar').sidebar('hide');
        $('.toc').appendTo($('.toc-wrapper'));
    }
}

$(window).resize(function () {
    moveToC();
});

moveToC();

$('.burger').click(function () {
    $('.ui.sidebar').sidebar('toggle');
});


$('body').on('click', '.sidebar .toc li', function () {
    $('.ui.sidebar').sidebar('hide');
});

$('body').on('click', '.search', function () {
    var viewportWidth = $(window).width();
    if (viewportWidth < 1000) {
        $('.search').addClass('active');
    }
});

$('body').on('blur', '.search.active', function () {
    var viewportWidth = $(window).width();
    if (viewportWidth < 1000) {
        $('.search').removeClass('active');
    }
});

$('.search').bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
    var viewportWidth = $(window).width();
    if (viewportWidth < 1000) {
        $('.search input').focus();
    }
});



$
@@ -38,33 +38,33 @@
 Width = 
-$(
 window
-).w
+.innerW
 idth
-()
 ;%0A    if
@@ -251,25 +251,26 @@
 %0A%7D%0A%0A
-$(
 window
-)
 .
+on
 resize
-(
+ = 
 func
@@ -295,18 +295,16 @@
 ToC();%0A%7D
-);
 %0A%0AmoveTo
@@ -313,126 +313,243 @@
 );%0A%0A
-$('.burger').click(function () %7B%0A    $('.ui.sidebar').sidebar('toggle');%0A%7D);%0A%0A%0A$('body').on('click', '.sidebar .toc li
+%0Avar burger = document.querySelector(%22.burger%22);%0Avar search = document.querySelector(%22.search%22);%0Avar searchInput = document.querySelector(%22.search input%22)%0Avar sidebar = document.querySelector(%22.sidebar%22)%0A%0Aburger.addEventListener('click
 ', f
@@ -554,25 +554,24 @@
  function ()
- 
 %7B%0A    $('.ui
@@ -586,27 +586,29 @@
 ').sidebar('
-hid
+toggl
 e');%0A%7D);%0A%0A$(
@@ -609,38 +609,38 @@
 );%0A%0A
-$('body').on('click', '.search
+search.addEventListener('click
 ', f
@@ -676,33 +676,33 @@
 Width = 
-$(
 window
-).w
+.innerW
 idth
-()
 ;%0A    if
@@ -739,29 +739,26 @@
     
-$('.search').addClass
+this.classList.add
 ('ac
@@ -780,44 +780,42 @@
 );%0A%0A
-$('body').on('blur', '.search.active
+searchInput.addEventListener('blur
 ', f
@@ -815,32 +815,33 @@
 lur', function (
+e
 ) %7B%0A    var view
@@ -891,32 +891,33 @@
 portWidth %3C 1000
+ 
 ) %7B%0A        $('.
@@ -916,32 +916,58 @@
     
-$('
+document.querySelector(%22
 .search
-'
+%22
 ).
+classList.
 remove
-Class
 ('ac
@@ -989,79 +989,189 @@
 );%0A%0A
-$('.search').bind('transitionend webkitTransitionEnd oTransitionEnd MST
+sidebar.addEventListener('click', function () %7B%0A    if (event.target.tagName.toLowerCase() === 'a') %7B%0A        $('.ui.sidebar').sidebar('hide');%0A    %7D%0A%7D);%0A%0Asearch.addEventListener('t
 rans
@@ -1175,17 +1175,17 @@
 ansition
-E
+e
 nd', fun
@@ -1189,18 +1189,20 @@
 function
+ 
 ()
+ 
 %7B%0A    va
@@ -1219,33 +1219,33 @@
 Width = 
-$(
 window
-).w
+.innerW
 idth
-()
 ;%0A    if
@@ -1282,26 +1282,19 @@
     
-$('.
 search
- i
+I
 nput
-')
 .foc
@@ -1312,9 +1312,4 @@
 %0A%7D);
-%0A%0A%0A%0A$

remove some jquery code