Flyer53 / jsPanel3

A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
http://v3.jspanel.de/
Other
89 stars 21 forks source link

Failed to restore header buttons #47

Closed dikirill closed 7 years ago

dikirill commented 7 years ago

Hi,

Try to create panel with hidden header controls:

var $jsPanel = $.jsPanel({
    headerControls: {minimize: 'remove', maximize: 'remove'}
});

Try now minimize (smallify) panel, and normalize it after by calling api:

$jsPanel.normalize();
$jsPanel.front();

And you will get error in the console and all hidden buttons will reappear:

Uncaught TypeError: Cannot read property 'style' of null

Pointing to this function:

        jsP.hideControls = function(sel) {
            Array.prototype.slice.call(jsP.header.controls[0].getElementsByClassName("jsPanel-btn")).forEach(function(item) {
                item.style.display = "block";
            });
            sel.forEach(function(item) {
---->          jsP.header.controls[0].querySelector(item).style.display = "none";
            });
        };
Flyer53 commented 7 years ago

@dikirill Can you tell me a bit more about your setup please? I tried in FF, Chrome, EDGE, IE11 and could not reproduce the error you report.

dikirill commented 7 years ago

@Flyer53 You right, I was trying to rebuild this case in the isolated code, and couldn't repro. I think I should close this issue.