GarethElms / BackboneJSModalView

I needed to use a Backbone.js view in a modal dialog. So I wrote a view base class that gives you a showModal() function
http://www.garethelms.org/2011/12/backbone-js-modal-dialog/
MIT License
63 stars 36 forks source link

Get actual document height #1

Closed lucaspinto closed 11 years ago

lucaspinto commented 11 years ago

When you use jQuery, the value you get is actually the window height. So that when you scroll down, the blank doesn't cover the page anymore.

So if you want to cover the whole page, you'll have to use document.height.

lucaspinto commented 11 years ago

I add the same change for the width.

GarethElms commented 11 years ago

Thanks for this. I'm just trying to reproduce it myself. My test page is ok if I scroll down before or after the modal appears :

http://www.garethelms.org/demo/backbone-js-modal-dialog/demo.html

Do you have a test page with this problem? I'll experiment more tonight.

GarethElms commented 11 years ago

I've just noticed that the blanket doesn't cover the bottom when I increase the height of the window after bringing up the dialog is this what you mean?

lucaspinto commented 11 years ago

Unfortunately, I don't have this page online right now. My page size is indeed extended after I open it, but before I bring up the dialog, and I guess it's why jQuery doesn't give me back a proper value. see: https://skitch.com/medkmedk/eu7dy/pixbob

GarethElms commented 11 years ago

Makes sense now, I'll look into and see if there's a jQuery way, otherwise I'll merge as is. Thanks

lucaspinto commented 11 years ago

Ok. You're welcome ;)

GarethElms commented 11 years ago

I wonder if this is an inherent problem with modal dialogs when the background is scrollable? Can you try it with bodyOverflowHidden true and let me if this suits your needs? It stops the page being scrollable while the modal dialog is visible. Twitter do something similar when you compose a tweet. view.render().showModal( {bodyOverflowHidden:true});

It would be good if I could see your problem first hand to make sure I know what your problem is.

lucaspinto commented 11 years ago

Indeed, we can't scroll anymore with this option and that'll be enough for me.

I'm sorry, I don't say a way I could let you access the application where I meet this issue or even a part/copy of it.