Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User wiseguy12851's Avatar
    Join Date
    May 2012
    Posts
    23
    Vote Rating
    2
    wiseguy12851 is on a distinguished road

      0  

    Default Custom component keeps mysteriously disappearing

    Custom component keeps mysteriously disappearing


    I have designed a custom component to self-embed a UnityObject, everything goes smoothly until I interact with the browser window (like resize it) which makes it immediately vanish.

    This maybe linked to the other problem I'm having - for some reason I can't initialize the object with the class in the initComponent section (nothing happens) so I'm placing the actual embed code in the "boxready" event.

    Any help would be appreciated, code is below and link to the problem is here:

    Code:
    Ext.define('Sandbox06112012a.view.Unity',
    {
        extend: 'Ext.Component',
        alias: 'widget.06112012a-unity',
        
        config:
        {
            file: 'WebPlayer.unity3d',
            loadBgColor: '#FFFFFF',
            loadBorderColor: '#FFFFFF',
            loadErrColor: '#000000',
            
            disContextMenu: false,
            disExtCall: false,
            disFullscreen: false
        },
        
        listeners:
        {
            boxready:
            {
                fn: function()
                {
                    console.log("boxready event");
                    console.log("embedding unity");
                    this.embedUnity();
                    console.log("unity embedded");
                }
            }
        },
        
        constructor: function(config)
        {    
            console.log("constructor called");
            this.initConfig(config);
            this.callParent(config);
        },
        
        initComponent: function()
        {
            console.log("initComponent called");
            this.embedOnce = false;
            
            this.callParent();
        },
        
        embedUnity : function()
        {
            console.log("embed unity called");
            if(typeof unityObject != "undefined" && this.embedOnce == false)
            {
                console.log("Now embedding");
                
                var params =
                {
                    backgroundcolor: this.loadBgColor,
                    bordercolor: this.loadBorderColor,
                    textcolor: this.loadErrColor,
                    
                    disableContextMenu: this.disContextMenu,
                    disableExternalCall: this.disExtCall,
                    disableFullscreen: this.disFullscreen
                };
                
                unityObject.embedUnity(this.id,
                                    this.file,
                                    '100%',
                                    '100%',
                                    params,
                                    null,
                                    function()
                {});
                
                this.embedOnce = true;
            }
        }
    });

    I speak English, ちょっと日本語を話します

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Jakarta
    Posts
    30
    Vote Rating
    2
    arivwd is on a distinguished road

      0  

    Default


    I usually used...

    Code:
    deferredRender: false,
    monitorResize: true,
    hideMode: 'offsets',
    for every layout that depends on browser/window resizing. IMHO

  3. #3
    Sencha User wiseguy12851's Avatar
    Join Date
    May 2012
    Posts
    23
    Vote Rating
    2
    wiseguy12851 is on a distinguished road

      0  

    Default


    I'm not relying on browser or window size, I mentioned that because that's one way I can reproduce the problem (by resizing browser window).

    I can't figure out what happens, one minute it's there and the next minute it's vanished - I've tried to get an idea through console.log but as far as I can tell it just vanishes without any trace, I'm not sure if it's hidden, offset, or actually destroyed nor what's causing this.

    I speak English, ちょっと日本語を話します

  4. #4
    Sencha User wiseguy12851's Avatar
    Join Date
    May 2012
    Posts
    23
    Vote Rating
    2
    wiseguy12851 is on a distinguished road

      0  

    Default


    After working with the problem some more I found where it's coming from, Upon a browser resize, Ext creates another div with the same id as the old one and because this is a "fit" layout it only shows 1 div at a time which is why it seemingly vanished

    Now I need to figure out why it's creating another "div" and how to fix it

    EDIT:
    I think I found out the problem, the way Unity embeds itself is by deleting the old tag and creating a new one with the same id, it does this because, in the event of a failure, the old tag will reamain (usually informing the user of the failure) but users never see this if it's loaded (because Unity replaces it with the player)

    ExtJS get's confused that one of it's tags is missing (because it doesn't recognize or even know about this new tag) so ExtJS recreates the tag. Well, this causes problems with Unity because it's been shoved aside for a new tag controlled by Ext JS under the "fit" layout. Unity must then manually be recreated only for the whole process to start over again.

    It's just a theory but I'm testing it now by placing another div inside of the component div for Unity to embed itself onto. I'll post again if it solved it or not

    I speak English, ちょっと日本語を話します

  5. #5
    Sencha User wiseguy12851's Avatar
    Join Date
    May 2012
    Posts
    23
    Vote Rating
    2
    wiseguy12851 is on a distinguished road

      0  

    Default


    That was the problem, the component html needed another div tag inside of it for unity to latch onto, otherwise it replaced the custom component entirely and ExtJs had to recreate it, messing up the layout which caused the already created Unity object to seemingly vanish (actually hidden).

    The problem has been fixed

    I speak English, ちょっと日本語を話します