tylergannon / toastr-rails

Rails engine for https://github.com/CodeSeven/toastr
GNU General Public License v2.0
105 stars 43 forks source link

How to add options? #10

Open ghost opened 7 years ago

ghost commented 7 years ago

How can I add options for toastr for a rails app? To which file? Can you please explain? I want to change the position and add a close button.

Boanerges7 commented 7 years ago

I've same problem and I don't know how to solve it. Someone help us?

jacobherrington commented 6 years ago

@enisdogru @Boanerges7 This isn't my gem, but you can add options in your JS files:

toastr.options = {
  "closeButton": false,
  "debug": false,
  "newestOnTop": false,
  "progressBar": false,
  "positionClass": "toast-top-right",
  "preventDuplicates": false,
  "onclick": null,
  "showDuration": "300",
  "hideDuration": "1000",
  "timeOut": "5000",
  "extendedTimeOut": "1000",
  "showEasing": "swing",
  "hideEasing": "linear",
  "showMethod": "fadeIn",
  "hideMethod": "fadeOut"
}

Only some of these options seem to work with the gem.