zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject zeppelin git commit: [ ZEPPELIN-1296 Optimization ] optimize to Paragraph move logic
Date Sat, 06 Aug 2016 15:20:21 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master ea76ca9f3 -> e2dcbfa89


[ ZEPPELIN-1296 Optimization ] optimize to Paragraph move logic

### What is this PR for?
optimize to Paragraph move logic
The problem is slowness of movement for the paragraph - paragraph.
I've optimized it.

### What type of PR is it?
Improvement

### Jira issue
https://issues.apache.org/jira/browse/ZEPPELIN-1296

### Todos
* [x] - when pargaraph move then pass to digest loop.

### How should this be tested?
1. create to many paragarph.
2. first or last row in pargarph.
3. on keypress to 'up' and down.

### Screenshots (if appropriate)
![111](https://cloud.githubusercontent.com/assets/10525473/17429668/d37adef6-5b2a-11e6-8e68-74e4e3a3c02f.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #1289 from cloverhearts/dev/paragraphMoveUpDownPerformanceUp and squashes the following
commits:

8379a53 [CloverHearts] remove white space between function ()
7ec8e98 [CloverHearts] optimize to Paragraph move logic


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/e2dcbfa8
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/e2dcbfa8
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/e2dcbfa8

Branch: refs/heads/master
Commit: e2dcbfa8970760b1778646bfa9fb8b4532d07cb3
Parents: ea76ca9
Author: CloverHearts <cloverheartsdev@gmail.com>
Authored: Fri Aug 5 17:08:45 2016 +0900
Committer: Lee moon soo <moon@apache.org>
Committed: Sat Aug 6 08:20:12 2016 -0700

----------------------------------------------------------------------
 .../app/notebook/paragraph/paragraph.controller.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e2dcbfa8/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 2925c47..9322351 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -622,13 +622,15 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope,
$r
         enableLiveAutocompletion: false
       });
 
-      $scope.handleFocus = function(value) {
+      $scope.handleFocus = function(value, isDigestPass) {
         $scope.paragraphFocused = value;
-        // Protect against error in case digest is already running
-        $timeout(function() {
-          // Apply changes since they come from 3rd party library
-          $scope.$digest();
-        });
+        if (isDigestPass === false || isDigestPass === undefined) {
+          // Protect against error in case digest is already running
+          $timeout(function() {
+            // Apply changes since they come from 3rd party library
+            $scope.$digest();
+          });
+        }
       };
 
       $scope.editor.on('focus', function() {
@@ -2383,7 +2385,8 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope,
$r
       $scope.handleFocus(true);
     } else {
       $scope.editor.blur();
-      $scope.handleFocus(false);
+      var isDigestPass = true;
+      $scope.handleFocus(false, isDigestPass);
     }
   });
 


Mime
View raw message