Sha256: 917cea1336d97fa469f207fe240645c3e1ff9029e821b36e83877ae820ed6190

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

require_relative '../helpers/indented_grid'

Coprl::Presenters.define(:snackbar) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :component_drawer
  page_title 'Snackbar'

  indented_grid do
    title 'On Page'
    body 'You can invoke or attach a snackbar on the server side and will render after load.'
    snackbar 'Top Level Important Information!'
    # This is the same as above -- see POM at end of file
    # attach :snackbar_attached

    title 'As Event'
    button 'Show Snackbar', id: :show_snackbar do
      event :click do
        snackbar 'You clicked snackbar the button!'
      end
    end

    blank

    title 'Response from a POST'
    body 'You can return a string or array of strings in your CRUD response (`messages.snackbar`) and it will display after the event fires.'
    button 'Show Snackbar from Response' do
      event :click do
        posts '/_echo_snackbar_', snackbar_echo: 'Your operation succeeded!'
      end
    end
  end

  attach :code, file: __FILE__
end

# Coprl::Presenters.define(:snackbar_attached) do
#   title 'In Attached'
#   body  'This can be done in an attached presenter as well'
#   snackbar 'Attached Snackbar Displayed!'
# end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 app/demo/components/snackbar.pom
coprl-3.0.0.beta.11 app/demo/components/snackbar.pom
coprl-3.0.0.beta.10 app/demo/components/snackbar.pom
coprl-3.0.0.beta.9 app/demo/components/snackbar.pom
coprl-3.0.0.beta.8 app/demo/components/snackbar.pom
coprl-3.0.0.beta.7 app/demo/components/snackbar.pom
coprl-3.0.0.beta.6 app/demo/components/snackbar.pom