cockpit/themes/model/theme.js in cpee-2.1.52 vs cockpit/themes/model/theme.js in cpee-2.1.53
- old
+ new
@@ -61,10 +61,13 @@
return JSON.stringify(nodes);
}; //}}}
//{{{ Render the details from rng (right hand side of graph tab)
this.update_details = function(svgid){
var tab = $('#dat_details');
+ var focus_ele = $(':focus',tab);
+ var focus_path = focus_ele.attr('data-relaxngui-path');
+ var focus_pos = focus_ele.prop('selectionStart');
var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
tab.empty();
if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
@@ -80,9 +83,16 @@
nn.removeAttr('svg-id');
nn.removeAttr('svg-type');
nn.removeAttr('svg-subtype');
nn.removeAttr('svg-label');
save['details'].content(nn);
+ if (focus_ele.length > 0) {
+ var ele = $('[data-relaxngui-path="' + focus_path + '"]',tab)[0];
+ ele.focus();
+ if (ele.setSelectionRange) {
+ ele.setSelectionRange(focus_pos,focus_pos);
+ }
+ }
format_visual_forms();
}
}; //}}}
function copyOrMove(menu,group,xml_node,mode) { //{{{