Flyer53 / jsPanel

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

is there something like getSize(), getHeight() or a similar way to get the size of a jsPanel? #39

Closed duyloc91 closed 9 years ago

duyloc91 commented 9 years ago

Is there anyway in which I can retrieve an panel's current size? I would like my web application to save user's preferences of panels' size into localstorage so users don't have to adjust the panels every visit.

Flyer53 commented 9 years ago

You can save/export the complete layout of all open jsPanels to localStorage and later import/restore this layout again.

Please take a look at http://jspanel.de/documentation/exportPanels.html where you can find a complete example how to do this.

Beside this you can access almost all panel data via the panel property option like:

var test = $.jsPanel();
console.log(test.option);

More questions? Don't hesitate to ask ...

duyloc91 commented 9 years ago

Thanks man, I have another question related to this. How can I detect user changes to the panels so that I can export the current panels into localstorage? The reason is that beforeunload doesn't work on all browsers.

Flyer53 commented 9 years ago

You're welcome ... Well, concerning panel status you could use the built in jsPanel events like jspanelmaximized, jspanelminimized and so on. For size and position I recommend the jQuery UI events. See

But from a users point of view ... Wouldn't it be better to privide a menu item like Save Layout Now for example. So the user could decide himself which layout he wants to save.

duyloc91 commented 9 years ago

Agree, I was thinking about a button as well. Did anyone report a flicker effect when using jsPanel.exportPanels() on Chrome before? On Firefox it works perfectly.

Flyer53 commented 9 years ago

No, I don't have such a report yet. But there's only one other project using jsPanel.exportPanels() I know of anyhow. And that's still in developement - http://chat.linux.uk/