Class: IRuby::Input::Cancel

Inherits:
Widget
  • Object
show all
Defined in:
lib/iruby/input/cancel.rb

Instance Method Summary collapse

Methods inherited from Widget

builder, #content, #widget_display, #widget_join

Instance Method Details

#widget_cssObject



10
11
12
# File 'lib/iruby/input/cancel.rb', line 10

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

#widget_htmlObject



22
23
24
25
26
27
28
29
# File 'lib/iruby/input/cancel.rb', line 22

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

#widget_jsObject



14
15
16
17
18
19
20
# File 'lib/iruby/input/cancel.rb', line 14

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