Good day, Habrovchane!Immediately excuse me for my Russian, since my native language is Ukrainian.I’m a Ruby On Rails developer and have been confronted with the need for modal windows in my projects many times. I tried many ready-made such as facebox, fancybox, dialogs with jQuery UI, and so on.
On one of my recent projects, the customer wanted to add a confirmation dialogue before deleting any resource. It was necessary to display a beautiful dialog box, and not a javascript alert that gives us rails ujs. Then the facebox was used in us and I had to climb the whole project to finish it all for facebook. And then I decided to write something of my own, but purely for the rails, so all the above mentioned are easy to fasten anywhere.
The main feature of the heme was the fact that standard rail configurations can be replaced only by writing one line in the application.js file. Added more support for images so that there is no need to put something else if you need a simple gallery on the project. Everything takes only 5kb. It works in all browsers and ie since the seventh version.
')
Looks like this:


The truth for IE is not such a beautiful shutter. To whom it would be necessary, well, right in all browsers it looked the same, you need to put an option:
$.lazybox.settings({niceClose: false})
Heme can:
- Confirm Dialogs
- Show page remout
- Show pictures
Easy installation
Gemfile:
gem 'lazybox'
application.js:
applications.css:
*= require lazybox
To replace standard applications in applications.js add
$.rails.allowAction = $.lazybox.confirm;
The library has many options. You can view it
here.Demo
hereThanks for attention.