(function () {
  var els = document.querySelectorAll('[data-role="tommy-expander"]')

  els.forEach(function (el) {
    el.classList.remove('is-hidden')
    el.addEventListener('click', onClick)
  });

  function onClick(e) {
    var target = e.currentTarget;
    var wrapper = target.parentNode;
    toggle(wrapper)
  }

  function toggle(el) {
    if (el.classList.contains('is-expanded')) {
      restore(el);
    } else {
      expand(el);
    }
  }

  function expand(el) {
    el.classList.add('is-expanded');
  }

  function restore(el) {
    el.classList.remove('is-expanded');
  }
})();

@@ -311,24 +311,181 @@
 apper)%0A  %7D%0A%0A
+  function createOnKeyUp(el) %7B%0A    return function (e) %7B%0A      var keyCode = e.keyCode;%0A%0A      if (keyCode === 27) %7B%0A        restore(el);%0A      %7D%0A    %7D%0A  %7D%0A%0A
   function t
@@ -492,24 +492,24 @@
 oggle(el) %7B%0A
-
     if (el.c
@@ -625,24 +625,83 @@
 xpand(el) %7B%0A
+    teardownKeyUpListener(el);%0A    setupKeyUpListener(el);%0A
     el.class
@@ -751,24 +751,55 @@
 store(el) %7B%0A
+    teardownKeyUpListener(el);%0A
     el.class
@@ -829,15 +829,366 @@
 d');%0A  %7D
+%0A%0A  function setupKeyUpListener(el) %7B%0A    var onKeyUp = createOnKeyUp(el);%0A    el.onKeyUpHandler = onKeyUp;%0A    document.addEventListener('keyup', onKeyUp);%0A  %7D%0A%0A  function teardownKeyUpListener(el) %7B%0A    var onKeyUp = el.onKeyUpHandler;%0A%0A    if (onKeyUp) %7B%0A      document.removeEventListener('keyup', onKeyUp);%0A    %7D%0A%0A    delete el.onKeyUpHandler%0A  %7D
 %0A%7D)();%0A

Handle ESC key to discard fullscreen