zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cornead...@apache.org
Subject zeppelin git commit: [ZEPPELIN-1333] prevent calling runParagraph() on shift-enter event
Date Fri, 19 Aug 2016 09:03:17 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master ff2465b9d -> 371fa76cd


[ZEPPELIN-1333] prevent calling runParagraph() on shift-enter event

### What is this PR for?
when shift-enter is pressed in text box of dynamic form, the paragraph runs twice.
1) ng-enter event handler
2) global event handler

blocking shift-enter in ng-enter event handler, this issue could be resolved.

### What type of PR is it?
[Bug Fix]

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1333

### How should this be tested?
![image](https://cloud.githubusercontent.com/assets/6119284/17725846/af8775b4-6489-11e6-912f-99dbc8a050bb.png)
the test case above should return 1 with enter event and shift-enter event.

Author: Steven Han <nazgul33@gmail.com>

Closes #1336 from nazgul33/master and squashes the following commits:

54c5142 [Steven Han] [ZEPPELIN-1333] prevent calling runParagraph() on shift-enter event


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

Branch: refs/heads/master
Commit: 371fa76cd558cf401322bc7fdd3fe266c3fd3741
Parents: ff2465b
Author: Steven Han <nazgul33@gmail.com>
Authored: Wed Aug 17 13:59:54 2016 +0900
Committer: Damien CORNEAU <corneadoug@gmail.com>
Committed: Fri Aug 19 18:03:08 2016 +0900

----------------------------------------------------------------------
 zeppelin-web/src/components/ngenter/ngenter.directive.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/371fa76c/zeppelin-web/src/components/ngenter/ngenter.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/ngenter/ngenter.directive.js b/zeppelin-web/src/components/ngenter/ngenter.directive.js
index f284c69..89826c9 100644
--- a/zeppelin-web/src/components/ngenter/ngenter.directive.js
+++ b/zeppelin-web/src/components/ngenter/ngenter.directive.js
@@ -17,9 +17,11 @@ angular.module('zeppelinWebApp').directive('ngEnter', function() {
   return function(scope, element, attrs) {
     element.bind('keydown keypress', function(event) {
       if (event.which === 13) {
-        scope.$apply(function() {
-          scope.$eval(attrs.ngEnter);
-        });
+        if (!event.shiftKey) {
+          scope.$apply(function() {
+            scope.$eval(attrs.ngEnter);
+          });
+        }
         event.preventDefault();
       }
     });


Mime
View raw message