"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 Toast = (function (_super) {
    __extends(Toast, _super);
    function Toast(msg) {
        var _this = _super.call(this) || this;
        if (msg) {
            _this._msg = msg;
        }
        _this._msg = msg;
        _this.msgTxt.text = _this._msg;
        return _this;
    }
    Object.defineProperty(Toast.prototype, "skinKey", {
        get: function () { return "Toast"; },
        enumerable: true,
        configurable: true
    });
    Toast.prototype.initEvents = function () {
        var _this = this;
        this.closeBtns.forEach(function (btn) { if (btn)
            btn.addEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
    };
    Toast.prototype.removeEvents = function () {
        var _this = this;
        this.closeBtns.forEach(function (btn) { if (btn)
            btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, _this.onTouchTap, _this); });
    };
    Object.defineProperty(Toast.prototype, "closeBtns", {
        get: function () { return [this['closeBtn']]; },
        enumerable: true,
        configurable: true
    });
    Toast.prototype.onTouchTap = function () {
        this.hidePanel();
    };
    Toast.prototype.hidePanel = function () {
        this.destroy();
        this.dispatchEvent(new egret.Event('onDestroy'));
    };
    return Toast;
}(ComponentBase_1.default));
exports.default = Toast;
__reflect(Toast.prototype, "\"e:/zqty/egret/src/views/Toast\".Toast");
//# sourceMappingURL=Toast.js.map