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

added height offset so we can trim it off later #27

Closed daavve closed 8 years ago

daavve commented 8 years ago

I'm new to bower, so I'm unfamiliar how to make the minified-js.

Anyway, when resizing I kept getting the bottom of my image cut off. I eventually discovered a really hacky fix for it.

Sorry I can't help more.

-Dave

Flyer53 commented 8 years ago

Hi Dave, could you show me some example code that produces your problem so that I can try to reproduce and check out the issue. Especially the content section is what I would like to see.

The code change you propose would result in the fact that the height setting passed to the method is not the height the panel will get. And since header height might vary it's not obvious at once what the panel height really is after resizing. Doesn't sound like a very good solution to me....

Maybe I can solve your problem when I have some code that reproduces your issue.

Regards, Stefan

PS: To minimize my js I use the Google Closure Compliler http://closure-compiler.appspot.com/home

daavve commented 8 years ago

Thank you for your response. I misunderstood that resize() is only supposed to resize the container as a whole. I've been using jsPanel to show changing images, and needed a convenient way to resize the panel in response to different sized content. Sort of like contentResize(), but in reverse. I restored resize() to it's natural state, and made a new function called resizeContent() that resizes the box based on a new content size.

Please let me know what you think.

-Dave

Flyer53 commented 8 years ago

Hi Dave, Thanks for your work :) and I'll consider this. But my approach to this is a bit different. Instead of having a method contentResize() and another method resizeContent() - would confuse me a bit - I modified the existing method .resize() to accept an additional parameter resize. If set to "content" only the content section will be resized.

$.jsPanel({
    theme:  'red',
    border: '2px solid'
}).resize({
    width:  600,
    height: 350,
    resize: 'content'
});
// values for width and height need to be pixel values in this case

Another point in favor of this approach is that it only needs 6 extra lines of code. Download the modified testfile from http://jspanel.de/downloads/jsPanel-3.4.0.2-test.zip and let me know how it works.

Stefan

daavve commented 8 years ago

Stefan,

I downloaded your testfile, and it works perfectly.

I'm not a big fan of cut & paste coding, and the new method name is pretty confusing.

Thanks for you help and quick response.

-Dave

Flyer53 commented 8 years ago

Hi Dave, The file you downloaded has some more changes beside the modified .resize() method (compared to the 3.4.0 release). I need to make some more tests and possibly add a few more things. So it might take a bit time until I release a new version. But I think you can safely use the 3.4.0.2 testfile and the .resize() addition will definitely bei in the next release.

Stefan :)

daavve commented 8 years ago

Thank you very much Stefan. This seems most appropriate!

-Dave