[IMP]improve code in view editor.

bzr revid: vme@tinyerp.com-20111116090421-qri7wmviyiygoxlo
This commit is contained in:
Vidhin Mehta (OpenERP) 2011-11-16 14:34:21 +05:30
parent 5ed7d8a8c2
commit a03506d84a
1 changed files with 8 additions and 6 deletions

View File

@ -467,8 +467,10 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
});
break;
case "side-remove":
self.do_save_update_arch
(one_object, view_id, view_xml_id, clicked_tr_id, clicked_tr_level, "remove_node");
if (confirm(_t("Do you really want to remove this node?"))) {
self.do_save_update_arch
(one_object, view_id, view_xml_id, clicked_tr_id, clicked_tr_level, "remove_node");
}
break;
case "side-edit":
var tr = $(this).closest("tr[id^='viewedit-']").find('a').text();
@ -656,11 +658,11 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
convert_to_utf = convert_to_utf.replace('xmlns="http://www.w3.org/1999/xhtml"', "");
convert_to_utf = '<?xml version="1.0"?>' + convert_to_utf;
arch.arch = convert_to_utf;
/*this.dataset.write(parseInt(view_id),{"arch":convert_to_utf}, function(r) {
});*/
this.dataset.write(parseInt(view_id),{"arch":convert_to_utf}, function(r) {
});
}else{
/*this.dataset.unlink([parseInt(view_id)],function(res) {
});*/
this.dataset.unlink([parseInt(view_id)],function(res) {
});
}
if(move_direct == "add_node"){
self.add_node_dialog.close();