Commit 5bd4883b authored by Jérome Perrin's avatar Jérome Perrin

jsplumb: some fixes for Internet Explorer

parent a861068e
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
<script src="../<%= curl.jsplumbjs.relative_dest %>"></script> <script src="../<%= curl.jsplumbjs.relative_dest %>"></script>
<script src="../<%= copy.handlebars.relative_dest %>"></script> <script src="../<%= copy.handlebars.relative_dest %>"></script>
<script src="../dream/mixin_gadget.js"></script>
<script src="../dream/mixin_promise.js"></script>
<script src="jsplumb.js"></script>
<script id="node-template" type="text/x-handlebars-template"> <script id="node-template" type="text/x-handlebars-template">
<div class="window {{class}}" <div class="window {{class}}"
id="{{element_id}}" id="{{element_id}}"
...@@ -22,8 +26,7 @@ ...@@ -22,8 +26,7 @@
<div class="ep"></div> <div class="ep"></div>
</div> </div>
</script> </script>
<script id="popup-edit-template" type="text/x-handlebars-template">
<template id="popup-edit-template">
<div id="edit-popup" data-position-to="origin"> <div id="edit-popup" data-position-to="origin">
<div data-role="header" data-theme="a"> <div data-role="header" data-theme="a">
<h1 class="node_class">Edit properties</h1> <h1 class="node_class">Edit properties</h1>
...@@ -36,12 +39,7 @@ ...@@ -36,12 +39,7 @@
<input type="submit" value="Validate"> <input type="submit" value="Validate">
</form> </form>
</div> </div>
</template> </script>
<script src="../dream/mixin_gadget.js"></script>
<script src="../dream/mixin_promise.js"></script>
<script src="jsplumb.js"></script>
</head> </head>
<body> <body>
<div id="main"></div> <div id="main"></div>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
.getElementById('node-template').innerHTML, .getElementById('node-template').innerHTML,
node_template = Handlebars.compile(node_template_source), node_template = Handlebars.compile(node_template_source),
popup_edit_template = gadget_klass.__template_element popup_edit_template = gadget_klass.__template_element
.getElementById('popup-edit-template'), .getElementById('popup-edit-template').innerHTML,
domParser = new DOMParser(); domParser = new DOMParser();
function loopJsplumbBind(gadget, type, callback) { function loopJsplumbBind(gadget, type, callback) {
...@@ -515,9 +515,9 @@ ...@@ -515,9 +515,9 @@
delete schema.properties.source; delete schema.properties.source;
delete schema.properties.destination; delete schema.properties.destination;
gadget.props.element.appendChild( gadget.props.element.insertAdjacentHTML(
document.importNode(popup_edit_template.content, true).children[0] 'beforeend',
); popup_edit_template);
edit_popup = $(gadget.props.element).find('#edit-popup'); edit_popup = $(gadget.props.element).find('#edit-popup');
edit_popup.find('.node_class').text(connection._class); edit_popup.find('.node_class').text(connection._class);
fieldset_element = edit_popup.find('fieldset')[0]; fieldset_element = edit_popup.find('fieldset')[0];
...@@ -621,9 +621,10 @@ ...@@ -621,9 +621,10 @@
node_edit_popup.remove(); node_edit_popup.remove();
} }
gadget.props.element.appendChild( gadget.props.element.insertAdjacentHTML(
document.importNode(popup_edit_template.content, true).children[0] 'beforeend',
); popup_edit_template);
node_edit_popup = $(gadget.props.element).find('#edit-popup'); node_edit_popup = $(gadget.props.element).find('#edit-popup');
// Set the name of the popup to the node class // Set the name of the popup to the node class
node_edit_popup.find('.node_class').text(node_data._class); node_edit_popup.find('.node_class').text(node_data._class);
......
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