v0.9.1 is out - jQueryless Boostrap Modal
Hi guys,
I’ve just released v0.9.1, where the most important change is the Drab.Modal is not dependent on jQuery anymore! And because of this, I have included it to the default modules, so it works out of the box (important for beginners).
Modal can be extremely useful, when you need a user input. Imagine that your function runs some SQL update, and you want to ask whether we should commit or rollback. With Drab.Modal.alert it is easier than anything:
case alert(socket, "DB update", "#{no_rows} updated.", buttons: [ok: "Commit", cancel: "Rollback"]) do
{:ok, _} -> commit(db, query)
{:cancel, _} -> rollback(db, query)
end
Modal can also have some inputs inside, in this case it returns their values as a second element of the return tuple.
iex(5)> alert socket, "Title", "<input name='fname'><input name='lname'>"
{:ok, %{"fname" => "Grzegorz", "lname" => "Brzęczyszczykiewicz"}}
This is a bootstrap modal, so it obviously needs bootstrap. But everything is prepared to add more css frameworks. I will add Foundation support in the spare time.
Drab.Query is (and will be) the only one module which is jQuery dependent. Long way since the first version announced here almost two years ago, as Drab - the jQuery in Elixir ![]()


















