Commit 0264efb8e6ddbd55255fdc5a2c1adccb0f22f1b6

Authored by 商艳涛
1 parent 2d5945e6

修复开始录制前代码编辑器里面已经存在的内容无法清空

Showing 1 changed file with 10 additions and 10 deletions
src/js/gb.js
@@ -1892,35 +1892,35 @@ $(function() { @@ -1892,35 +1892,35 @@ $(function() {
1892 * @return {[type]} [description] 1892 * @return {[type]} [description]
1893 */ 1893 */
1894 resetCodeMirrorValue: function(num) { 1894 resetCodeMirrorValue: function(num) {
  1895 + console.info('GBCodePlayBack.resetCodeMirrorValue');
1895 var _this = this; 1896 var _this = this;
1896 var _thisNum = num; 1897 var _thisNum = num;
1897 if (_thisNum == 0) { 1898 if (_thisNum == 0) {
1898 for (var i = 0; i < treeLinkEditor.length; i++) { 1899 for (var i = 0; i < treeLinkEditor.length; i++) {
1899 - if (treeLinkEditor[i].CodeMirrorRecord.getValue() != undefined) {  
1900 - ZTREE.showEdite({'treeNode': treeLinkEditor[i].file, 'replay': true}); 1900 + if (treeLinkEditor[i].CodeMirrorRecord.getValue()) {
  1901 + ZTREE.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
1901 treeLinkEditor[i].CodeMirrorRecord.setValue(""); 1902 treeLinkEditor[i].CodeMirrorRecord.setValue("");
1902 } 1903 }
1903 } 1904 }
1904 } else if (_thisNum == 1) { 1905 } else if (_thisNum == 1) {
1905 for (var i = 0; i < treeLinkEditor.length; i++) { 1906 for (var i = 0; i < treeLinkEditor.length; i++) {
1906 - if (treeLinkEditor[i].CodeMirrorReplay.getValue() != undefined) {  
1907 - ZTREE.showEdite({'treeNode': treeLinkEditor[i].file, 'replay': true}); 1907 + if (treeLinkEditor[i].CodeMirrorReplay.getValue()) {
  1908 + ZTREE.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
1908 treeLinkEditor[i].CodeMirrorReplay.setValue(""); 1909 treeLinkEditor[i].CodeMirrorReplay.setValue("");
1909 } 1910 }
1910 } 1911 }
1911 } else { 1912 } else {
1912 for (var i = 0; i < treeLinkEditor.length; i++) { 1913 for (var i = 0; i < treeLinkEditor.length; i++) {
1913 -  
1914 - if (treeLinkEditor[i].CodeMirrorRecord.getValue() != undefined) {  
1915 - ZTREE.showEdite({'treeNode': treeLinkEditor[i].file, 'replay': true}); 1914 + if(treeLinkEditor[i].CodeMirrorRecord.getValue()){
  1915 + ZTREE.showEdite({'treeNode': {'name': treeLinkEditor[i].file}});
1916 treeLinkEditor[i].CodeMirrorRecord.setValue(""); 1916 treeLinkEditor[i].CodeMirrorRecord.setValue("");
1917 - }  
1918 - if (treeLinkEditor[i].CodeMirrorReplay.getValue() != undefined) {  
1919 - ZTREE.showEdite({'treeNode': treeLinkEditor[i].file, 'replay': true}); 1917 + }else if(treeLinkEditor[i].CodeMirrorReplay.getValue()){
  1918 + ZTREE.showEdite({'treeNode': {'name': treeLinkEditor[i].file}, 'replay': true});
1920 treeLinkEditor[i].CodeMirrorReplay.setValue(""); 1919 treeLinkEditor[i].CodeMirrorReplay.setValue("");
1921 } 1920 }
1922 } 1921 }
1923 } 1922 }
  1923 + ZTREE.showEdite({'treeNode': {'name': treeLinkEditor[0].file}});
1924 }, 1924 },
1925 /** 1925 /**
1926 * 获取各个文件中的代码 1926 * 获取各个文件中的代码