Module: Prawn::Print::JS

Included in:
Prawn::Print
Defined in:
lib/prawn-print/js.rb

Constant Summary collapse

NAME_TREE_CHILDREN_LIMIT =

The maximum number of children to fit into a single node in the JavaScript tree.

20

Instance Method Summary collapse

Instance Method Details

#add_docopen_js(name, script) ⇒ Object

add a Javascript fragment that will execute when the document is opened.

There can only be as many fragments as required. Calling this function multiple times will append the new fragment to the list.



16
17
18
19
# File 'lib/prawn-print/js.rb', line 16

def add_docopen_js(name, script)
  obj = ref!(:S => :JavaScript, :JS => script)
  javascript.data.add(name, obj)
end