Commit 724be956 authored by Jérome Perrin's avatar Jérome Perrin

Graph Editor: do not depend on gadget mixin

parent c19e9003
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
* along with DREAM. If not, see <http://www.gnu.org/licenses/>. * along with DREAM. If not, see <http://www.gnu.org/licenses/>.
* ==========================================================================*/ * ==========================================================================*/
/*global RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin, /*global RSVP, rJS, $, jsPlumb, Handlebars,
loopEventListener, promiseEventListener, DOMParser, confirm */ loopEventListener, promiseEventListener, DOMParser, confirm */
/*jslint unparam: true todo: true */ /*jslint unparam: true todo: true */
(function (RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin, (function (RSVP, rJS, $, jsPlumb, Handlebars,
loopEventListener, promiseEventListener, DOMParser) { loopEventListener, promiseEventListener, DOMParser) {
"use strict"; "use strict";
...@@ -712,12 +712,9 @@ ...@@ -712,12 +712,9 @@
RSVP.Promise(resolver, canceller) ]); RSVP.Promise(resolver, canceller) ]);
} }
initGadgetMixin(gadget_klass);
gadget_klass gadget_klass
.declareAcquiredMethod('notifyDataChanged', 'notifyDataChanged')
.ready(function (g) { .ready(function (g) {
g.props = {};
g.props.node_id_to_dom_element_id = {}; g.props.node_id_to_dom_element_id = {};
g.props.zoom_level = 1.0; g.props.zoom_level = 1.0;
g.props.style_attr_list = [ g.props.style_attr_list = [
...@@ -726,8 +723,11 @@ ...@@ -726,8 +723,11 @@
'padding-top', 'padding-top',
'line-height' 'line-height'
]; ];
g.getElement().then( function (element) {
g.props.element = element;
});
}) })
.declareAcquiredMethod('notifyDataChanged', 'notifyDataChanged')
.declareMethod('render', function (data) { .declareMethod('render', function (data) {
this.props.data = JSON.parse(data); this.props.data = JSON.parse(data);
this.props.jsplumb_instance = jsPlumb.getInstance(); this.props.jsplumb_instance = jsPlumb.getInstance();
...@@ -757,5 +757,5 @@ ...@@ -757,5 +757,5 @@
gadget.props.nodes_click_monitor gadget.props.nodes_click_monitor
]); ]);
}); });
}(RSVP, rJS, $, jsPlumb, Handlebars, initGadgetMixin, }(RSVP, rJS, $, jsPlumb, Handlebars, loopEventListener,
loopEventListener, promiseEventListener, DOMParser)); promiseEventListener, DOMParser));
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