"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 Panel_1 = require("../views/Panel");
var ToastPanel = (function (_super) {
    __extends(ToastPanel, _super);
    function ToastPanel() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(ToastPanel.prototype, "skinKey", {
        get: function () { return 'ToastPanel'; },
        enumerable: true,
        configurable: true
    });
    ToastPanel.prototype.start = function (data) {
        this.mdata = data;
        this.percentHeight = 100;
    };
    ToastPanel.prototype.onSkinComplete = function () {
        _super.prototype.onSkinComplete.call(this);
        this.pMask.visible = false;
        this.showAct();
        this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
        if (this.stage) {
            this.onLoad();
        }
    };
    ToastPanel.prototype.initEvents = function () {
        _super.prototype.initEvents.call(this);
        // this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_this, this);
    };
    ToastPanel.prototype.removeEvents = function () {
        _super.prototype.removeEvents.call(this);
        // this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_this, this);
    };
    ToastPanel.prototype.ontap_this = function () {
    };
    ToastPanel.prototype.onLoad = function () {
        if (this.mdata) {
            if (this.mdata.line > 2) {
                this.bgRect.height = 150 + (this.mdata.line - 2) * 30;
            }
            this.msgLb.text = this.mdata.msg;
            if (this.mdata.width) {
                this.bgRect.width = this.mdata.width;
            }
            if (this.mdata.height) {
                this.bgRect.height = this.mdata.height;
            }
        }
        setTimeout(function () {
            egret.Tween.get(this).to({ alpha: 0 }, 500, egret.Ease.quintOut).call(function () {
                this.onTouchTap();
            }.bind(this));
        }.bind(this), 1000);
    };
    return ToastPanel;
}(Panel_1.default));
exports.default = ToastPanel;
__reflect(ToastPanel.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/newGame/saolei19.03.06/db-game-template/egret/src/toastPanel/ToastPanel\".ToastPanel");
//# sourceMappingURL=ToastPanel.js.map