webpackHotUpdate(4,{

/***/ "./module/index.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(module) {/* unused harmony export emitter */
/* unused harmony export toggleLeft */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return showLeft; });
/* unused harmony export hideLeft */
/* unused harmony export toggleRight */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return showRight; });
/* unused harmony export hideRight */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__("./node_modules/react/cjs/react.development.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tiny_emitter__ = __webpack_require__("./node_modules/tiny-emitter/index.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tiny_emitter___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_tiny_emitter__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__styles__ = __webpack_require__("./module/styles.js");
var _jsxFileName = '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

(function () {
  var enterModule = __webpack_require__("./node_modules/react-hot-loader/patch.js").enterModule;

  enterModule && enterModule(module);
})();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }






var defaultWidth = '300px';

var emitter = new __WEBPACK_IMPORTED_MODULE_1_tiny_emitter___default.a();
var showStatus = {
  left: false,
  right: false
};

var toggleLeft = function toggleLeft() {
  var show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !showStatus.left;

  showStatus.left = show;
  emitter.emit('toggle', showStatus);
};
var showLeft = function showLeft() {
  return toggleLeft(true);
};
var hideLeft = function hideLeft() {
  return toggleLeft(false);
};

var toggleRight = function toggleRight() {
  var show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !showStatus.right;

  showStatus.right = show;
  emitter.emit('toggle', showStatus);
};
var showRight = function showRight() {
  return toggleRight(true);
};
var hideRight = function hideRight() {
  return toggleRight(false);
};

var CrystallizeLayout = function (_Component) {
  _inherits(CrystallizeLayout, _Component);

  function CrystallizeLayout() {
    var _ref;

    var _temp, _this, _ret;

    _classCallCheck(this, CrystallizeLayout);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CrystallizeLayout.__proto__ || Object.getPrototypeOf(CrystallizeLayout)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
      showLeft: showStatus.left,
      showRight: showStatus.right
    }, _this.onToggle = function (_ref2) {
      var left = _ref2.left,
          right = _ref2.right;

      _this.setState({
        showLeft: left,
        showRight: right
      });

      if (left || right) {
        _this.disableScroll(true);
      } else {
        _this.disableScroll(false);
      }
    }, _this.onOverlayClick = function (e) {
      e.preventDefault();
      toggleLeft(false);
      toggleRight(false);
    }, _this.renderChildren = function (additionalProps) {
      return __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.map(_this.props.children, function (child) {
        return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, additionalProps);
      });
    }, _temp), _possibleConstructorReturn(_this, _ret);
  }

  _createClass(CrystallizeLayout, [{
    key: 'componentDidMount',
    value: function componentDidMount() {
      emitter.on('toggle', this.onToggle);
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      emitter.off('toggle', this.onToggle);
    }
  }, {
    key: 'disableScroll',
    value: function disableScroll(stop) {
      if (!this.defaultBodyOverflow) {
        var style = getComputedStyle(document.body);
        this.defaultBodyOverflow = style.overflowY;
      }
      document.body.style.overflowY = stop ? 'hidden' : this.defaultBodyOverflow;
    }
  }, {
    key: 'render',
    value: function render() {
      var _props = this.props,
          left = _props.left,
          right = _props.right,
          _props$width = _props.width,
          width = _props$width === undefined ? defaultWidth : _props$width,
          leftWidth = _props.leftWidth,
          rightWidth = _props.rightWidth;


      var leftWidthToUse = leftWidth || width;
      var rightWidthToUse = rightWidth || width;

      var _state = this.state,
          showLeft = _state.showLeft,
          showRight = _state.showRight;


      var contentPushed = '0px';
      if (showLeft) {
        contentPushed = leftWidthToUse;
      } else if (showRight) {
        contentPushed = '-' + rightWidthToUse;
      }

      var LeftCmp = left || null;
      var RightCmp = right || null;

      return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
        __WEBPACK_IMPORTED_MODULE_2__styles__["d" /* Outer */],
        {
          showLeft: showLeft,
          showRight: showRight,
          leftWidth: leftWidthToUse,
          rightWidth: rightWidthToUse,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 100
          }
        },
        (showLeft || showRight) && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__styles__["a" /* ClickOverlay */], { onClick: this.onOverlayClick, __source: {
            fileName: _jsxFileName,
            lineNumber: 107
          }
        }),
        __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
          __WEBPACK_IMPORTED_MODULE_2__styles__["b" /* Content */],
          {
            __source: {
              fileName: _jsxFileName,
              lineNumber: 109
            }
          },
          this.renderChildren({
            leftShown: showLeft,
            rightShown: showRight,
            contentPushed: contentPushed
          })
        ),
        LeftCmp && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
          __WEBPACK_IMPORTED_MODULE_2__styles__["c" /* Left */],
          { width: leftWidthToUse, show: showLeft, __source: {
              fileName: _jsxFileName,
              lineNumber: 117
            }
          },
          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(LeftCmp, { shown: showLeft, __source: {
              fileName: _jsxFileName,
              lineNumber: 118
            }
          })
        ),
        RightCmp && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
          __WEBPACK_IMPORTED_MODULE_2__styles__["e" /* Right */],
          { width: rightWidthToUse, show: showRight, __source: {
              fileName: _jsxFileName,
              lineNumber: 122
            }
          },
          __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(RightCmp, { shown: showRight, __source: {
              fileName: _jsxFileName,
              lineNumber: 123
            }
          })
        )
      );
    }
  }, {
    key: '__reactstandin__regenerateByEval',
    value: function __reactstandin__regenerateByEval(key, code) {
      this[key] = eval(code);
    }
  }]);

  return CrystallizeLayout;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);

var _default = CrystallizeLayout;
/* harmony default export */ __webpack_exports__["a"] = (_default);
;

(function () {
  var reactHotLoader = __webpack_require__("./node_modules/react-hot-loader/patch.js").default;

  var leaveModule = __webpack_require__("./node_modules/react-hot-loader/patch.js").leaveModule;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(defaultWidth, 'defaultWidth', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(emitter, 'emitter', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(showStatus, 'showStatus', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(toggleLeft, 'toggleLeft', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(showLeft, 'showLeft', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(hideLeft, 'hideLeft', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(toggleRight, 'toggleRight', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(showRight, 'showRight', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(hideRight, 'hideRight', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(CrystallizeLayout, 'CrystallizeLayout', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  reactHotLoader.register(_default, 'default', '/Users/hakonmartinholmsenkrogh/www/react-layout/module/index.js');
  leaveModule(module);
})();

;
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__("./node_modules/next/node_modules/webpack/buildin/harmony-module.js")(module)))

/***/ })

})
//# sourceMappingURL=4.0f4ebe38457ef3e78f59.hot-update.js.map