Repository: zeppelin Updated Branches: refs/heads/branch-0.6 c6e42ec7b -> cceeecec3
[ ZEPPELIN-1266 ] Code editor Optimization ### What is this PR for? If the result of many para- graph, the code editor is very slow. ### What type of PR is it? Improvement ### Todos - [x] removed call to function in template. - [x] changed event (aceChange event to ace input event) ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-1266 ### How should this be tested? 1. going to r tutorial notebook. 2. write to paragraph on anyway. (many many.. fast.. fast typing.) ### Screenshots (if appropriate) #### Before optimization.  #### After optimization.  ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: CloverHearts <[email protected]> Closes #1258 from cloverhearts/dev/aceeditorperformance and squashes the following commits: 2bde378 [CloverHearts] removed local variable setParagarphmode to global variable for code editor optimization. 9e2c7fc [CloverHearts] restore to aceChanged function for code editor optimization 86ba5c4 [CloverHearts] ace editor performance up (cherry picked from commit adf33558779662bd49b27b38afe8287e9f61cb4e) Signed-off-by: Mina Lee <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/cceeecec Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/cceeecec Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/cceeecec Branch: refs/heads/branch-0.6 Commit: cceeecec3f6707557b198a66b9c0692f6d0f3d36 Parents: c6e42ec Author: CloverHearts <[email protected]> Authored: Wed Aug 3 14:13:14 2016 +0900 Committer: Mina Lee <[email protected]> Committed: Fri Aug 5 12:11:42 2016 +0900 ---------------------------------------------------------------------- .../src/app/notebook/paragraph/paragraph.controller.js | 6 ++---- zeppelin-web/src/app/notebook/paragraph/paragraph.html | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/cceeecec/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 9800a1d..d2b6271 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -711,10 +711,7 @@ angular.module('zeppelinWebApp') $scope.aceChanged = function() { $scope.dirtyText = $scope.editor.getSession().getValue(); $scope.startSaveTimer(); - - $timeout(function() { - $scope.setParagraphMode($scope.editor.getSession(), $scope.dirtyText, $scope.editor.getCursorPosition()); - }); + $scope.setParagraphMode($scope.editor.getSession(), $scope.dirtyText, $scope.editor.getCursorPosition()); }; $scope.aceLoaded = function(_editor) { @@ -723,6 +720,7 @@ angular.module('zeppelinWebApp') _editor.$blockScrolling = Infinity; $scope.editor = _editor; + $scope.editor.on('input', $scope.aceChanged); if (_editor.container.id !== '{{paragraph.id}}_editor') { $scope.editor.renderer.setShowGutter($scope.paragraph.config.lineNumbers); $scope.editor.setShowFoldWidgets(false); http://git-wip-us.apache.org/repos/asf/zeppelin/blob/cceeecec/zeppelin-web/src/app/notebook/paragraph/paragraph.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.html b/zeppelin-web/src/app/notebook/paragraph/paragraph.html index 0157c02..0364825 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.html +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.html @@ -41,7 +41,6 @@ limitations under the License. class="editor" ui-ace="{ onLoad : aceLoaded, - onChange: aceChanged, require : ['ace/ext/language_tools'] }" ng-model="paragraph.text"
