diff --git a/_server/editor_mode.js b/_server/editor_mode.js index 5ca0f7b0..d7b8e728 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -97,14 +97,12 @@ editor_mode = function (editor) { } editor_mode.prototype.onmode = function (mode, callback) { - //setTimeout(function(){ - if (editor_mode.mode != mode) { - if (mode === 'save') editor_mode.doActionList(editor_mode.mode, editor_mode.actionList, callback); - if (editor_mode.mode === 'nextChange' && mode) editor_mode.showMode(mode); - if (mode !== 'save') editor_mode.mode = mode; - editor_mode.actionList = []; - } - //}) + if (editor_mode.mode != mode) { + if (mode === 'save') editor_mode.doActionList(editor_mode.mode, editor_mode.actionList, callback); + if (editor_mode.mode === 'nextChange' && mode) editor_mode.showMode(mode); + if (mode !== 'save') editor_mode.mode = mode; + editor_mode.actionList = []; + } } editor_mode.prototype.showMode = function (mode) { diff --git a/_server/editor_table.js b/_server/editor_table.js index 1788515b..bfb38185 100644 --- a/_server/editor_table.js +++ b/_server/editor_table.js @@ -224,8 +224,10 @@ editor_table_wrapper = function (editor) { var listen = function (guids) { // 每个叶节点的事件绑定 + var tableid = editor.util.guid(); + editor.mode.currentTable=tableid; guids.forEach(function (guid) { - editor.table.guidListen(guid, obj, commentObj) + editor.table.guidListen(guid, tableid, obj, commentObj) }); } return { "HTML": outstr.join(''), "guids": guids, "listen": listen }; @@ -309,7 +311,7 @@ editor_table_wrapper = function (editor) { * 监听一个guid对应的表格项 * @param {String} guid */ - editor_table.prototype.guidListen = function (guid, obj, commentObj) { + editor_table.prototype.guidListen = function (guid, tableid, obj, commentObj) { // tr>td[title=field] // >td[title=comment,cobj=cobj:json] // >td>div>input[value=thiseval] @@ -318,6 +320,7 @@ editor_table_wrapper = function (editor) { var field = thisTr.children[0].getAttribute('title'); var cobj = JSON.parse(thisTr.children[1].getAttribute('cobj')); var modeNode = thisTr.parentNode; + thisTr.setAttribute('tableid',tableid) while (!editor_mode._ids.hasOwnProperty(modeNode.getAttribute('id'))) { modeNode = modeNode.parentNode; } @@ -341,6 +344,7 @@ editor_table_wrapper = function (editor) { */ editor_table.prototype.onchange = function (guid, obj, commentObj, thisTr, input, field, cobj, modeNode) { editor_mode.onmode(editor_mode._ids[modeNode.getAttribute('id')]); + if (editor.mode.currentTable!=thisTr.getAttribute('tableid')) return; var thiseval = null; if (input.checked != null) input.value = input.checked; try {