saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

Feature suggestion : Give an id/class to dialogue as an option. #26

Closed mikecastrodemaria closed 8 years ago

mikecastrodemaria commented 8 years ago

Feature suggestion : add to options the ability to set an id and or class to the dialogue.

Ex param : var params = {modalId = 'my-modal-id', modalclass = 'my-modal-class' } Ex modal :

It will help a lot to modify modal contextually. Thanks

oliverschloebe commented 8 years ago

+1

saribe commented 8 years ago

You can access the element, do you really need the id?

var promiseAndMore = eModal.alert('Hello Jack', 'From Madam');

promiseAndMore.element
     .find('modal-body')
     .addClass('my-very-cool-animation');

In the returned object from eModal execution, you get the jQuery DOM element reference. You can do what ever you what with it.

But by the id or class could be helpful for you?

saribe commented 8 years ago

Any update on this?

Can you give me an example why should we add this feature?

maxi032 commented 8 years ago

because sometimes we need to check if the modal is shown or hidden and do stuff based on that

saribe commented 8 years ago

Now it is possible to set id on eModal

eModal.setId('your-id');