Method: Vis::Timeline#set_window

Defined in:
lib/vis/timeline.rb

#set_window(start_time, end_time, options = {}, &block) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/vis/timeline.rb', line 113

def set_window(start_time, end_time, options = {}, &block)
  native_options = options_to_native(options)
  if block_given?
    callback = %x{
      function() {
        return block.$call();
      }
    }
    @native.JS.setWindow(start_time, end_time, native_options, callback)
  else
    @native.JS.setWindow(start_time, end_time, native_options)
  end
end