"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(data) {
        var _this = _super.call(this, data) || this;
        _this.mdata = data;
        return _this;
    }
    Object.defineProperty(ToastPanel.prototype, "skinKey", {
        get: function () {
            return 'ToastPanel';
        },
        enumerable: true,
        configurable: true
    });
    ToastPanel.prototype.onShowAnim = function () {
    };
    ToastPanel.prototype.onSkinComplete = function () {
        _super.prototype.onSkinComplete.call(this);
        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;
            // }
        }
        var canvasW = 750 / window.innerWidth * window.innerWidth;
        var canvasH = 750 / window.innerWidth * window.innerHeight;
        this.anchorOffsetX = this.width / 2;
        this.anchorOffsetY = this.height / 2;
        this.x = canvasW / 2;
        this.y = canvasH / 2;
        egret.Tween.removeTweens(this);
        egret.Tween.get(this)
            .set({ scaleX: 0, scaleY: 0 })
            .to({ scaleX: 1, scaleY: 1 }, 330, egret.Ease.backOut)
            .wait(800)
            .to({ alpha: 0 }, 500, egret.Ease.quadInOut)
            .call(this.onTouchClose.bind(this));
    };
    return ToastPanel;
}(Panel_1.default));
exports.default = ToastPanel;
__reflect(ToastPanel.prototype, "\"/Users/haiyoucuv/Documents/Web/\u5DE5\u884C\u5361\u4E2D\u5FC3--\u6B22\u8DA3\u5E84\u56ED\u6D3B\u52A8/JoyousManor/egret/src/Panels/toastPanel/ToastPanel\".ToastPanel");
//# sourceMappingURL=ToastPanel.js.map