Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desktop.js -> setDesktopSize() bug #107

Open
partikule opened this issue Apr 19, 2011 · 3 comments
Open

desktop.js -> setDesktopSize() bug #107

partikule opened this issue Apr 19, 2011 · 3 comments

Comments

@partikule
Copy link

For internal use, I need to call the setDesktopSize() method of desktop.js (because I dynamically hide the desktop header, and the desktop size need to be recalculated after hidding the desktop header.)

Using the previous version, I just fired the window resize() event (this also doesn't work).

The error comes from the method panelHeight2()

panels.each(function(panel){
    var instance = MUI.get(panel.id);
       /**
        * The panel exists, but the panel.id is set to nothing
       */
    if (panel.getParent().hasClass('expanded') && panel.getParent().getNext('.expanded')){
...
}

I added a plaster, but I'm not convinced :

        panels.each(function(panel){
            var instance = MUI.get(panel.id);
            if (typeOf(instance) != 'null')
            {
@partikule
Copy link
Author

I found some more informations about this bug.
I init 2 panels, "structurePanel" and "mainPanel".
When the I call setDesktopSize, one instance of "structurePanel" is in the panels array, but without any id.

Here is my init script, if it can help.

    MUI.create({
        'control':'MUI.Desktop',
        'id':'desktop',
        'taskbar':true,
        'content':[
            {name:'header', url: admin_url + 'desktop/get_header'},
            {name:'taskbar'},
            {name:'content',columns:[
                {id: 'sideColumn', placement: 'left', width: 280, resizeLimit: [222, 600],
                    panels:[
                        {
                            id: 'structurePanel',
                            title: '',
                            content: [
                                {url: admin_url + 'core/get_structure'},
                                {
                                    name: 'toolbox',
                                    position: 'header',
                                    cssClass: 'left',
                                    divider: false,
                                    url: admin_url + 'desktop/get/toolboxes/structure_toolbox'
                                }
                                
                            ]
                        }
                    ]
                },
                {id: 'mainColumn',  placement: 'main', resizeLimit: [100, 300],
                    panels:[
                    {
                        id: 'mainPanel',
                        title: Lang.get('ionize_title_welcome'),
                        content: [
                            {url: admin_url + 'dashboard'},
                            {
                                name: 'toolbox',
                                position: 'header',
                                url: admin_url + 'desktop/get/toolboxes/empty_toolbox'
                            }
                        ]
                    }]
                }
            ]}
        ]
    });

@partikule
Copy link
Author

Found more info about this problem.
The "collapse" button returned also an error (panel.js -> collapse function())

A deeper check indicates that panelWrapper.getAllPrevious('.panelWrapper') returns 2 objects for the structurePanel_wrapper :

  • One with IDs on each element (wrapper & childs)
  • One with no IDs. Looks like a phantom object.

A check of the Panel initialize returns that the Panel object was just called 2 times, one time for the panel "structurePanel" and one time for the panel "mainPanel".

@cdotyone
Copy link
Owner

I think this was caused by drag event not being caputured during collapse/expand. This has been fixed. Please verify you are still having problem with newest code.
-Chris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants