{% extends "analysisbase/scenario_causetree_edit.html" %} {% block extra_context_menu %} if (this._get_type(obj) == 'event' || this._get_type(obj) == 'condition') { items.toggle_cause = { label : "{% trans "Toggle cause type" %}", icon : "create", action : function (obj) { var rollback = $.jstree._reference($("#tree")).get_rollback() obj = this._get_node(obj); var type = this._get_type(obj); if (type == 'event' || type == 'condition') { if (type == 'event') { this.set_type('condition', obj); } if (type == 'condition') { this.set_type('event', obj); } var action = 'togglecause|'+ obj.attr('id') + ';'; setAction(action, rollback); } }, separator_before : true } } {% endblock %}