cockpit/js/instance.js in cpee-1.4.8 vs cockpit/js/instance.js in cpee-1.4.10
- old
+ new
@@ -365,12 +365,14 @@
function adaptor_update() { //{{{
$('g.element[element-endpoint]').each(function(k,ele){
if (save['endpoints_cache'][$(ele).attr('element-endpoint')] && save['endpoints_cache'][$(ele).attr('element-endpoint')]) {
var c = $(ele).find('g.replace');
- var symbol = save['endpoints_cache'][$(ele).attr('element-endpoint')].symbol.documentElement;
- c.replaceWith($(symbol).clone());
+ var symbol = save['endpoints_cache'][$(ele).attr('element-endpoint')].symbol;
+ if (symbol) {
+ c.replaceWith($(symbol.documentElement).clone());
+ }
}
});
} //}}}
function adaptor_init(url,theme,dslx) { //{{{
if (save['graph_theme'] != theme) {
@@ -737,10 +739,11 @@
type: "PUT",
url: url + "/properties/values/state",
data: ({value: res}),
error: report_failure,
success: function(res){
- if (exec) start_instance();
+ // use promises you filthy animal
+ if (exec) setTimeout(start_instance,2000);
}
});
}
});
}// }}}