Sha256: 45dff5422b057f385fb5ea97d8f382d889ffbabd4d9d3c7e02c712a60d4e30a4

Contents?: true

Size: 620 Bytes

Versions: 9

Compression:

Stored size: 620 Bytes

Contents

module IRuby
  module Input
    class Cancel < Widget
      needs :label

      builder :cancel do |label='Cancel'|
        add_button Cancel.new(label: label)
      end

      def widget_css
        ".iruby-cancel { margin-left: 5px; }"
      end

      def widget_js
        <<-JS
          $('.iruby-cancel').click(function(){
            $('#iruby-form').remove();
          });
        JS
      end

      def widget_html
        button(
          @label,
          type: 'button',
          :'data-dismiss' => 'modal',
          class: "btn btn-danger pull-right iruby-cancel"
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iruby-0.8.0 lib/iruby/input/cancel.rb
iruby-0.7.4 lib/iruby/input/cancel.rb
iruby-0.7.3 lib/iruby/input/cancel.rb
iruby-0.7.2 lib/iruby/input/cancel.rb
iruby-0.7.1 lib/iruby/input/cancel.rb
iruby-0.7.0 lib/iruby/input/cancel.rb
iruby-0.6.1 lib/iruby/input/cancel.rb
iruby-0.6.0 lib/iruby/input/cancel.rb
iruby-0.5.0 lib/iruby/input/cancel.rb