1. #1
    Sencha User Snape's Avatar
    Join Date
    Jul 2007
    Posts
    41
    Vote Rating
    0
    Snape is on a distinguished road

      0  

    Default [2.0] mask() on document.body always scrolls to top of page

    [2.0] mask() on document.body always scrolls to top of page


    The following code always scrolls page to position (0, 0), which is not very convinient if user has to fix error in the bottom of the page when mask disappears (he has to scroll to bottom)

    Code:
    maskedElement = Ext.get(document.body);
    maskedElement.mask('Processing...', 'x-mask-loading');
    Expected behavior: mask appears but page does not scroll.

    When testing page height must be larger than viewport height.

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    We'll look into it.

  3. #3
    Ext User
    Join Date
    Jun 2007
    Posts
    5
    Vote Rating
    0
    jozzhart is on a distinguished road

      0  

    Default Unmask Call

    Unmask Call


    Hello,

    Snape, could you please tell me what object/event do I attach the maskedElement.unmask() to with this example?

    Thanks,
    Joel

  4. #4
    Sencha User Snape's Avatar
    Join Date
    Jul 2007
    Posts
    41
    Vote Rating
    0
    Snape is on a distinguished road

      0  

    Default


    You call unmask() when you know that action is complete. How otherwise?

    For example, I call mask() before ajax call and unmask() when call returns.

  5. #5
    Sencha User Snape's Avatar
    Join Date
    Jul 2007
    Posts
    41
    Vote Rating
    0
    Snape is on a distinguished road

      0  

    Default


    Quote Originally Posted by brian.moeskau View Post
    We'll look into it.
    Thanks a lot!

  6. #6
    Ext User
    Join Date
    Jun 2007
    Posts
    5
    Vote Rating
    0
    jozzhart is on a distinguished road

      0  

    Default


    ok, I called the unmask function from the render event on my viewport. This was what I was looking for, thanks snape

    Quote Originally Posted by Snape View Post
    You call unmask() when you know that action is complete. How otherwise?

    For example, I call mask() before ajax call and unmask() when call returns.

  7. #7
    Sencha - Training Team RWaters's Avatar
    Join Date
    Mar 2007
    Location
    Los Angeles, CA
    Posts
    714
    Vote Rating
    0
    RWaters is on a distinguished road

      0  

    Default


    Snape, I've started poking around with this issue and am not sure there is a way to fix it without breaking the expected functionality of the mask message. The problem is when centering the div that holds the mask message. The expected function is that this will center the message within the current viewport, but it has the drawback of scrolling the page up when centering. I'll poke around a bit more, but I'm not confident that it can be resolved without breaking the normal centering functionality.

  8. #8
    Sencha User Snape's Avatar
    Join Date
    Jul 2007
    Posts
    41
    Vote Rating
    0
    Snape is on a distinguished road

      0  

    Default


    I hope it can be done... This issue is really inconvinient for practical applications. I undersnad the complexity...

    If it cannot be fixed without breaking existing functionality, then can new method (maskEx or mask2) be created? Or may be you can provide instructions or source code for achiving the same functionality without scrolling? This would be really great. I like mask() but scrolling problem kills its advantages over waitBox.

    I really hope you can solve it in Ext!

  9. #9
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    2
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    The issue boils down to the fact that the class "x-masked" gets applied to the masked element, which sets overflow to hidden (no scroll bars). This is done to avoid having to monitor for scrolling and make adjustments to mask and mask message positions, which could get messy. The workaround to avoid resetting your scroll position is simple:
    Code:
    Ext.override(Ext.Element, {
        mask : function(msg, msgCls){
            if(this.getStyle("position") == "static"){
                this.setStyle("position", "relative");
            }
            if(this._maskMsg){
                this._maskMsg.remove();
            }
            if(this._mask){
                this._mask.remove();
            }
    
            this._mask = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask"}, true);
    
            this.addClass("x-masked"); // <-- remove
            this._mask.setDisplayed(true);
            if(typeof msg == 'string'){
                this._maskMsg = Ext.DomHelper.append(this.dom, {cls:"ext-el-mask-msg", cn:{tag:'div'}}, true);
                var mm = this._maskMsg;
                mm.dom.className = msgCls ? "ext-el-mask-msg " + msgCls : "ext-el-mask-msg";
                mm.dom.firstChild.innerHTML = msg;
                mm.setDisplayed(true);
                mm.center(this);
            }
            if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && this.getStyle('height') == 'auto'){ // ie will not expand full height automatically
                this._mask.setSize(this.dom.clientWidth, this.getHeight());
            }
            return this._mask;
        }
    });
    However, whether or not this works as desired in every case is doubtful, so for now, you'll have to override it yourself if you need it.

  10. #10
    Sencha User Snape's Avatar
    Join Date
    Jul 2007
    Posts
    41
    Vote Rating
    0
    Snape is on a distinguished road

      0  

    Default


    Brian, thanks a lot! I will try and let you know in this thread if I find any errors.

    I am not experienced in ExtJS internal, so I need one small advice from you. Can I just copy/paste this code to my JS file? I do not need to modify ExtJS core, right?

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi