Commit 5567c4c0 authored by Jérome Perrin's avatar Jérome Perrin Committed by Ioannis Papagiannopoulos

Graph Editor: Make it easier to use another element than #main

parent b6501b94
...@@ -150,8 +150,8 @@ ...@@ -150,8 +150,8 @@
function convertToAbsolutePosition(gadget, x, y) { function convertToAbsolutePosition(gadget, x, y) {
var zoom_level = gadget.props.zoom_level * 1.1111, var zoom_level = gadget.props.zoom_level * 1.1111,
canvas_size_x = $(gadget.props.element).find('#main').width(), canvas_size_x = $(gadget.props.main).width(),
canvas_size_y = $(gadget.props.element).find('#main').height(), canvas_size_y = $(gadget.props.main).height(),
size_x = $(gadget.props.element).find('.dummy_window').width() * size_x = $(gadget.props.element).find('.dummy_window').width() *
zoom_level, zoom_level,
size_y = $(gadget.props.element).find('.dummy_window').height() * size_y = $(gadget.props.element).find('.dummy_window').height() *
...@@ -163,8 +163,8 @@ ...@@ -163,8 +163,8 @@
function convertToRelativePosition(gadget, x, y) { function convertToRelativePosition(gadget, x, y) {
var zoom_level = gadget.props.zoom_level * 1.1111, var zoom_level = gadget.props.zoom_level * 1.1111,
canvas_size_x = $(gadget.props.element).find('#main').width(), canvas_size_x = $(gadget.props.main).width(),
canvas_size_y = $(gadget.props.element).find('#main').height(), canvas_size_y = $(gadget.props.main).height(),
size_x = $(gadget.props.element).find('.dummy_window').width() * size_x = $(gadget.props.element).find('.dummy_window').width() *
zoom_level, zoom_level,
size_y = $(gadget.props.element).find('.dummy_window').height() * size_y = $(gadget.props.element).find('.dummy_window').height() *
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
} }
function addNode(gadget, node_id, node_data) { function addNode(gadget, node_id, node_data) {
var render_element = $(gadget.props.element).find("#main"), var render_element = $(gadget.props.main),
class_definition = gadget.props.data.class_definition[node_data._class], class_definition = gadget.props.data.class_definition[node_data._class],
coordinate = node_data.coordinate, coordinate = node_data.coordinate,
dom_element_id, dom_element_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment