function _classCallCheck(a, h) { if (!(a instanceof h)) throw new TypeError("Cannot call a class as a function") } var _createClass = function () { function a(a, h) { for (var i = 0; i < h.length; i++) { var c = h[i]; c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(a, c.key, c) } } return function (h, c, $) { return c && a(h.prototype, c), $ && a(h, $), h } }(), mHeader = function () { function a() { _classCallCheck(this, a), this.$header = $(".dw-common-header"), this.$menuWrap = this.$header.find(".tool-bar-wrap"), this.$menu = this.$menuWrap.find(".tool-bar-menu"), this.$detail = this.$header.find(".dw-menu-detail"), this.$shade = this.$header.find(".header-shade"), this.detailOffset, this.init() } return _createClass(a, [{ key: "init", value: function () { this.setPcUrl().detailInit().menuClick().shadeClick().setHeaderTitle(), document.body.addEventListener("touchstart", function () { }, !1) } }, { key: "detailInit", value: function () { return this.detailOffset = this.$detail.height(), this.$detail.css("transform", "translateY(-" + this.detailOffset + "px)").show(), this } }, { key: "menuClick", value: function () { { var a = this; this.$menu } return this.$menuWrap.click(function (e) { var h = a.$menu; h.hasClass("close") ? (h.removeClass("close").addClass("open"), a.$detail.css("transform", "translateY(0px)"), a.$shade.show()) : (h.removeClass("open").addClass("close"), a.$detail.css("transform", "translateY(-" + a.detailOffset + "px)"), a.$shade.hide()), e.stopPropagation() }), this } }, { key: "shadeClick", value: function () { var a = this; return $(".header-shade").click(function () { a.$menu.click() }), this } }, { key: "setHeaderTitle", value: function () { var a = $("body").data("title"); if (a) { var h = $("<span>" + a + "</span>"); this.$header.find(".dw-link").append(h) } return this } }, { key: "setPcUrl", value: function () { var a = $("html").attr("data-pcurl"); return a && $(".pc-icon").attr("href", a), this } }]), a }(); $(function () { new mHeader });