awkward / backbone.modal

A plugin for Backbone.js that simplifies creating modals for your application.
http://awkward.github.io/backbone.modal/
Other
362 stars 71 forks source link

Add CSS classes to the created element in the modal? #79

Closed george-silva closed 6 years ago

george-silva commented 9 years ago

I want to have variable width modals. I can configure them in the view, using the className property. But that is applied to the bbm-wrapper element.

Is it possible to configure a class to be dinamically in the div that comes with bbm-modal class?

zeakd commented 9 years ago

The problem is, setting className on BackBone.Modal is adding them to '.bbm-wrapper', not .bbm-modal. I solved it just adding '.bbm-modal-{{size}}' on modalElement

onRender: function () {
    this.modalEl.addClass('bbm-modal-large')
}
.bbm-modal {
  max-width: none;
}
.bbm-modal-large {
  width : 980px;
}
jimf commented 6 years ago

Closing due to age, but feel free to reopen. I'd recommend onRender as well though.