cockpit/themes/adventure/theme.js in cpee-1.3.185 vs cockpit/themes/adventure/theme.js in cpee-1.3.187
- old
+ new
@@ -28,19 +28,20 @@
if (sibling) {
group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node);
if(group.length > 0) menu['Insert after'] = group;
}
- if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete)
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
icon.children('.rfill').css({'fill':'#ff7f7f','fill-opacity':'1'});
menu['Delete'] = [{
'label': 'Remove Element',
'function_call': self.adaptor.description.remove,
'menu_icon': icon,
'params': [null, xml_node]
}];
+ }
if($('> finalize, > update', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
var icon = self.elements.callmanipulate.illustrator.svg.clone();
icon.children('.rfill:last').css({'fill':'#ff7f7f','fill-opacity':'1'});
menu['Delete'].push({
'label': 'Remove Scripts',
@@ -51,35 +52,41 @@
}
new CustomMenu(e).contextmenu(menu);
}
return false;
} // }}}
- this.events.click = function(svgid, e) { // {{{
+ this.events.click = function(svgid) { // {{{
+ var visid = 'details';
+ var tab = $('#dat_' + visid);
+ tab.empty();
+
if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
return;
}
- $('g.activities').removeClass('clicked');
- $(e.target).parent('g.activities').addClass('clicked');
+ self.adaptor.illustrator.get_nodes().removeClass('clicked');
+ var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
+ if (vtarget.length > 0) {
+ vtarget.addClass('clicked');
+ }
+
if ($('#state').text() != 'finished')
$('#main ui-behind button').show();
if ($('#main ui-behind button').hasClass('highlight')) {
var check = confirm("Discard changes?");
if (check)
$('#main ui-behind button').removeClass('highlight');
else
return;
}
- var visid = 'details';
- var tab = $('#dat_' + visid);
var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
- save[visid + '_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
-
- tab.empty();
- save[visid] = new RelaxNGui(self.adaptor.description.elements[$(node).attr('svg-type')],tab,self.adaptor.description.context_eval);
- save[visid].content(node);
+ if (self.adaptor.description.elements[$(node).attr('svg-type')]) {
+ save[visid + '_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
+ save[visid] = new RelaxNGui(self.adaptor.description.elements[$(node).attr('svg-type')],tab,self.adaptor.description.context_eval);
+ save[visid].content(node);
+ }
} // }}}
this.events.dblclick = function(svgid, e) { // {{{
} // }}}
this.events.mouseover = function(svgid, e) { // {{{
$('.tile[element-id = "' + svgid + '"]').css('display','block');