Sha256: fd247c8dac98761134f849d64b3a1fb186fbca8f55bfa28ea01fc749bef65616
Contents?: true
Size: 859 Bytes
Versions: 26
Compression:
Stored size: 859 Bytes
Contents
class App.Views.Shared.Flash extends App.Views.Base constructor: (opts = {}) -> super opts @notice = opts.notice ? null @alert = opts.alert ? null @warning = opts.warning ? null @hide = opts.hide ? true setNotice: (text) -> @notice = text setAlert: (text) -> @alert = text setWarning: (text) -> @warning = text render: -> node = $('.flash') node.removeClass('notice').removeClass('alert').removeClass('warning') if @notice? node.addClass 'notice' node.find('p').text @notice else if @alert? node.addClass 'alert' node.find('p').text @alert else if @warning? node.addClass 'warning' node.find('p').text @warning node.slideDown 'normal' this.hideAfterTime() if @hide hideAfterTime: (time = 4000) -> setTimeout -> $('.flash').slideUp 'normal' , time
Version data entries
26 entries across 26 versions & 1 rubygems