Repository: incubator-zeppelin Updated Branches: refs/heads/master f7670c8f6 -> c760351b8
ZEPPELIN-480 Enter/return key on create/clone notebook In current behaviour on pressing enter/return key on create/clone notebook doesn't do anything. Expected behaviour is it should be equivalent of create/cone. Author: Prabhjyot Singh <[email protected]> Closes #509 from prabhjyotsingh/ZEPPELIN-480 and squashes the following commits: 766fba4 [Prabhjyot Singh] Enter/return key on create/clone notebook Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/c760351b Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/c760351b Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/c760351b Branch: refs/heads/master Commit: c760351b8e84906dd2271d79d2fbe9305dce33fc Parents: f7670c8 Author: Prabhjyot Singh <[email protected]> Authored: Thu Dec 3 12:54:33 2015 +0530 Committer: Damien CORNEAU <[email protected]> Committed: Wed Dec 9 11:04:33 2015 +0900 ---------------------------------------------------------------------- .../src/components/noteName-create/note-name-dialog.html | 4 ++-- .../src/components/noteName-create/notename.controller.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/c760351b/zeppelin-web/src/components/noteName-create/note-name-dialog.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/noteName-create/note-name-dialog.html b/zeppelin-web/src/components/noteName-create/note-name-dialog.html index d1bcd49..74149bc 100644 --- a/zeppelin-web/src/components/noteName-create/note-name-dialog.html +++ b/zeppelin-web/src/components/noteName-create/note-name-dialog.html @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - <div id="noteNameModal" class="modal fade" role="dialog" modalvisible previsiblecallback="notenamectrl.preVisible" + <div id="noteNameModal" class="modal fade" role="dialog" modalvisible previsiblecallback="notenamectrl.preVisible" targetinput="noteName" tabindex='-1'> <div class="modal-dialog"> @@ -26,7 +26,7 @@ limitations under the License. <div class="form-group"> <label for="noteName">Note Name</label> <input placeholder="Note name" type="text" class="form-control" - id="noteName" ng-model="note.notename"> + id="noteName" ng-model="note.notename" ng-enter="notenamectrl.handleNameEnter()"> </div> </div> <div class="modal-footer"> http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/c760351b/zeppelin-web/src/components/noteName-create/notename.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/noteName-create/notename.controller.js b/zeppelin-web/src/components/noteName-create/notename.controller.js index 430e60d..4529844 100644 --- a/zeppelin-web/src/components/noteName-create/notename.controller.js +++ b/zeppelin-web/src/components/noteName-create/notename.controller.js @@ -14,7 +14,8 @@ 'use strict'; -angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $rootScope, $routeParams, websocketMsgSrv, $location) { +angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $rootScope, $routeParams, websocketMsgSrv, + $location) { var vm = this; vm.websocketMsgSrv = websocketMsgSrv; $scope.note = {}; @@ -28,6 +29,11 @@ angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $ro } }; + vm.handleNameEnter = function(){ + angular.element('#noteNameModal').modal('toggle'); + vm.createNote(); + }; + $scope.$on('setNoteContent', function(event, note) { //a hack, to make it run only after notebook creation //it should not run i.e in case of linking to the paragraph
