The solution for Ext.MessageBox getting stuck when clicked multiple times

The reason is simple: if the animation doesn't call the end time, the cleanup code is called.

Ext.Component.prototype.animateFn = // or Ext.override( Ext.Component, { animateFn:
            function (animation, component, newState, oldState, options, controller) {
                var me = this;
                if (animation && (!newState || (newState && this.isPainted()))) {

                    this.activeAnimation = new Ext.fx.Animation(animation);
                    this.activeAnimation.setElement(component.element);

                    if (!Ext.isEmpty(newState)) {
                        var onEndInvoked = false;
                        var onEnd = function () {
                            if (!onEndInvoked) {
                                onEndInvoked = true;
                                me.activeAnimation = null;
                                controller.resume();
                            }
                        };

                        this.activeAnimation.setOnEnd(onEnd);
                        window.setTimeout(onEnd, 50 + (this.activeAnimation.getDuration() || 500));

                        controller.pause();
                    }

                    Ext.Animator.run(me.activeAnimation);
                }
            };

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327067780&siteId=291194637