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

Crash after two viewed images #9

Closed
zemat opened this issue Mar 31, 2014 · 10 comments
Closed

Crash after two viewed images #9

zemat opened this issue Mar 31, 2014 · 10 comments
Labels

Comments

@zemat
Copy link

zemat commented Mar 31, 2014

Hi,

FYI, your plugin is crashing for me after I view more than two photos, error below:

TypeError: Cannot call method 'open' of undefined

@vodkabears
Copy link
Owner

Hi. Can you show me your code?

@vodkabears
Copy link
Owner

@zemat Do you still have the problem?

@ameetshah
Copy link

Hi,

I am also facing the same issue.
I am using it with asp .net mvc (not that is should affect)
I am loading a form in the popup.

When I see the the html using (inspect element) when it fails, Two remodal overlay elements are visible

tworemodaloverlayvisible

Also the base page content moves on popup, and moves back when closed.

ameet

@vodkabears
Copy link
Owner

@ameetshah Looks like you try to create it several times.

If you want to create it, you don't need js, just set the 'remodal' class:

<div class="remodal" data-remodal-id="modal">
...modal content...
</div>

If you want to create it with js, remove 'remodal' class from the element and do this:

<div data-remodal-id="modal">
...modal content...
</div>
var inst = $('[data-remodal-id=modal]').remodal(options);
// open from js
inst.open();

If you want to find the instance of the created one and open it from js:

var inst = $.remodal.lookup[$('[data-remodal-id=modal]').data('remodal')];
inst.open();

Are you sure you're doing everything right?

@ameetshah
Copy link

@vodkabears

I was using it the same way as I use JQUery Dialog, assuming that when we call close. the dialog/popup is no longer in the DOM.

I changed the open code to following
var inst = $.remodal.lookup[$('[data-remodal-id=modal]').data('remodal')];
if(!inst)
{

                                            $('[data-remodal-id=modal]').remodal().open();
                                        }
                                        else
                                        {
                                            inst.open();
                                        }

This solved the issue.

Though a suggestion, would it not be better, if we could just use standard open all the time ?

..

Also the whole html background is moving to left when the popup opens, and comes back when it closes. I am using chrome.

Thanks
ameet

@vodkabears
Copy link
Owner

@ameetshah Background doesn't move, when modal opens, padding appears on the position of the scroll bar.

@ameetshah
Copy link

Hi @vodkabears

If you go here
http://www.ubiqs.in/demo/AjaxMVC/user/list
UserName: VodkaBears
Pwd: VOdKaBears_95

and click create new button, the popup comes, when you close it you see the background moving left.

regards
ameet

@vodkabears
Copy link
Owner

@ameetshah ok, it's a bit strange, because script calculates width of the scroll bar, but there is no scroll bar. I will look at this later. As a fast workaround set this css property of the body: padding-right: 0 !important;.

@ameetshah
Copy link

Thank you Sir.

It worked.

Ameet
www.ubiqs.in

On Thu, Apr 24, 2014 at 3:27 PM, Ilya notifications@github.com wrote:

@ameetshah https://github.com/ameetshah ok, it's a bit strange, because
script calculates width of the scroll bar, but there is no scroll bar. I
will look at this later. As a fast workaround set this css property to the
body: padding-right: 0 !important;.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-41262617
.

vodkabears added a commit that referenced this issue May 3, 2014
vodkabears added a commit that referenced this issue May 3, 2014
@vodkabears
Copy link
Owner

@ameetshah Download new version, padding was fixed. https://github.com/VodkaBears/Remodal/releases/tag/0.1.5

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

No branches or pull requests

3 participants