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

Original event is not available for onShow and onClose #130

Closed
pomartel opened this issue Oct 4, 2018 · 14 comments
Closed

Original event is not available for onShow and onClose #130

pomartel opened this issue Oct 4, 2018 · 14 comments

Comments

@pomartel
Copy link

pomartel commented Oct 4, 2018

The original event that triggers the opening and closing of the modal is not passed to the onShow or onClose function. This is useful information for my project (ie. need to read a data-attribute on the link that opened the modal) so I added the functionality to my repo in this commit: pomartel@daf4a43

I can bundle this in a clean pull request if it can be useful to others.

@MahbbRah
Copy link

YES YES, I'm in badly needs of this feature :(
I tried your updated codes didn't work. can you do readme so we can use that?

@Antimated
Copy link

Very much in need of this

@ghosh
Copy link
Owner

ghosh commented May 3, 2019

@pomartel Would you be open to submitting a PR?

@pomartel
Copy link
Author

pomartel commented May 3, 2019

Sure @ghosh , I'll have a look at it next week!

zebapy added a commit to middlebury/midd-frontend that referenced this issue May 14, 2019
… be link

Otherwise link will work as normal and take user to page.

Use until this is closed ghosh/Micromodal#130
@ghosh ghosh added this to the Next milestone May 23, 2019
@sashahohloma
Copy link

sashahohloma commented Jun 19, 2019

I think, i found solution by using other method - show(id, options)
You can use this method with you custom data-attribute, also you should add event listner for this elements.
Check my example:

var modalCustomSelector = 'data-custom-selector';

document.querySelectorAll('[' + modalCustomSelector + ']').forEach( (element) => {
    element.addEventListener('click', (event) => {

        event.preventDefault();
        var modalCustomId = event.target.closest('[' + modalCustomSelector + ']').getAttribute(modalCustomSelector);
        
        MicroModal.show(modalCustomId, {
            disableScroll: true,
            awaitCloseAnimation: true
        });

    });
});

If MicroModal was called this way, you can use MicroModal.close('data-custom-selector')

@pjoulot
Copy link
Contributor

pjoulot commented Nov 13, 2019

I have found this issue because I was reading the documentation.

I have been through the code and it has been fixed already, but the documentation has not been updated :(

There is a pull request. #258

@ghosh
Copy link
Owner

ghosh commented Nov 14, 2019

Thanks @pjoulot. Seems like I missed this.

@ghosh ghosh closed this as completed Nov 14, 2019
@jmosbech
Copy link
Contributor

@ghosh and @pjoulot The npm version and the code in master does not seem to have these changes. Am I missing something?

@ghosh ghosh reopened this Feb 20, 2020
@ghosh
Copy link
Owner

ghosh commented Feb 20, 2020

@jmosbech This is scheduled for the next release. This should not have been closed before.

@ghosh ghosh removed this from the Next milestone Feb 20, 2020
@DmytroLitvinov
Copy link

Hi @ghosh ,

Thanks a lot of reporting :)
Could we be aware when new release with passing event will released?

@ghosh
Copy link
Owner

ghosh commented Mar 13, 2020

@DmytroLitvinov It should be released in a few weeks.

@ghosh
Copy link
Owner

ghosh commented Mar 25, 2020

Fixed in 0.4.3

@ghosh ghosh closed this as completed Mar 25, 2020
@DmytroLitvinov
Copy link

Thanks for release :)
Maybe it would also good to track release on GitHub?

@ghosh
Copy link
Owner

ghosh commented Mar 25, 2020

Yes planing on doing that. I'm trying to setup github actions for release. Should be able to track releases on GH soon.

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

No branches or pull requests

8 participants