"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var ComponentBase_1 = require("../components/ComponentBase");
var Panel = (function (_super) {
    __extends(Panel, _super);
    function Panel() {
        return _super.call(this) || this;
    }
    Panel.prototype.initEvents = function () {
        var _this = this;
        if (this.closeBtns && this.closeBtns.length > 0) {
            this.closeBtns.forEach(function (btn) { if (btn)
                btn.addEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
        }
        if (this.confirmBtns && this.confirmBtns.length > 0) {
            this.confirmBtns.forEach(function (btn) { if (btn)
                btn.addEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
        }
        if (this.creditsOutBtns && this.creditsOutBtns.length > 0) {
            this.creditsOutBtns.forEach(function (btn) { if (btn)
                btn.addEventListener(egret.TouchEvent.TOUCH_TAP, _this.creditsOut, _this); });
        }
    };
    Panel.prototype.removeEvents = function () {
        var _this = this;
        if (this.closeBtns && this.closeBtns.length > 0) {
            this.closeBtns.forEach(function (btn) { if (btn)
                btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
        }
        if (this.confirmBtns && this.confirmBtns.length > 0) {
            this.confirmBtns.forEach(function (btn) { if (btn)
                btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
        }
        if (this.creditsOutBtns && this.creditsOutBtns.length > 0) {
            this.creditsOutBtns.forEach(function (btn) { if (btn)
                btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, _this.creditsOut, _this); });
        }
    };
    Object.defineProperty(Panel.prototype, "closeBtns", {
        get: function () { return [this['closeBtn']]; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Panel.prototype, "confirmBtns", {
        get: function () { return [this['confirmBtn']]; },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Panel.prototype, "creditsOutBtns", {
        get: function () { return [this['creditsOutBtn']]; },
        enumerable: true,
        configurable: true
    });
    Panel.prototype.onTouchTap = function () {
        this.hidePanel();
    };
    Panel.prototype.hidePanel = function () {
        this.destroy();
        this.dispatchEvent(new egret.Event('onDestroy'));
    };
    Panel.prototype.creditsOut = function () {
        this.destroy();
        this.dispatchEvent(new egret.Event('onCreditsOut'));
    };
    return Panel;
}(ComponentBase_1.default));
exports.default = Panel;
__reflect(Panel.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/gameegret20181011/db-game-template/egret/src/views/Panel\".Panel");
//# sourceMappingURL=Panel.js.map