浏览代码

Editor: Avoid compiling when changing contents.

Mr.doob 9 年之前
父节点
当前提交
1ceb1bd730
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      editor/js/Script.js

+ 2 - 0
editor/js/Script.js

@@ -71,6 +71,8 @@ var Script = function ( editor ) {
 	codemirror.setOption( 'theme', 'monokai' );
 	codemirror.setOption( 'theme', 'monokai' );
 	codemirror.on( 'change', function () {
 	codemirror.on( 'change', function () {
 
 
+		if ( codemirror.state.focused === false ) return;
+
 		clearTimeout( delay );
 		clearTimeout( delay );
 		delay = setTimeout( function () {
 		delay = setTimeout( function () {