estum / growlyflash

Growl-styled flash messages for Ruby on Rails and Bootstrap
MIT License
58 stars 34 forks source link

Regression? Title appeared after upgrading to 0.8.5 #35

Open alphabt opened 8 years ago

alphabt commented 8 years ago

After upgrading to 0.8.5 I now see all alerts have the title showing (the "Info!" part). When I revert back to 0.8.4.1 the title went away.

alert_with_title

My setting has title turned off:

Growlyflash.defaults = $.extend on, Growlyflash.defaults,
  align:   'right'  # horizontal aligning (left, right or center)
  delay:   4000     # auto-dismiss timeout (0 to disable auto-dismiss)
  dismiss: yes      # allow to show close button
  spacing: 10       # spacing between alerts
  target:  'body'   # selector to target element where to place alerts
  title:   no       # switch for adding a title

Is this a regression/bug?

yurijmi commented 8 years ago

It's a bug. See #33 For now just rollback to 0.8.4.1

alphabt commented 8 years ago

I found the the offending code in #33. On line 47:

html += h.title(@opts.type) if title? and @opts.type?

title? translates to title != null in js, which is the wrong since it doesn't check against values yes or no. Reverting the line to just title now works as expected.

I've opened PR #36, could you take a look and merge if ok?

yurijmi commented 8 years ago

@iczman you basically made a complete copy of #34

alphabt commented 8 years ago

Lol I should've look through existing PRs first. Bummer, I'll withdraw my PR.

yurijmi commented 8 years ago

@iczman hehe. was about to make that same mistake a week ago xD