Skip to content

Commit 7d933f0

Browse files
committed
fix bootstrap dialog default button
1 parent 82af1e7 commit 7d933f0

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

zeppelin-web/src/app/app.controller.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ angular.module('zeppelinWebApp').controller('MainCtrl', function($scope, $rootSc
2020
var init = function() {
2121
$scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false);
2222
};
23-
23+
2424
init();
2525

2626
$rootScope.$on('setIframe', function(event, data) {
@@ -36,10 +36,13 @@ angular.module('zeppelinWebApp').controller('MainCtrl', function($scope, $rootSc
3636
event.preventDefault();
3737
}
3838
});
39-
39+
4040
// Set The lookAndFeel to default on every page
4141
$rootScope.$on('$routeChangeStart', function(event, next, current) {
4242
$rootScope.$broadcast('setLookAndFeel', 'default');
4343
});
4444

45+
BootstrapDialog.defaultOptions.onshown = function() {
46+
angular.element('#'+this.id).find('.btn:last').focus();
47+
};
4548
});

zeppelin-web/src/app/notebook/notebook.controller.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
115115
angular.element('#' + n.id + '_paragraphColumn_main').scope().runParagraph(n.text);
116116
});
117117
}
118-
}
118+
},
119+
closable: true,
120+
closeByBackdrop: false,
121+
closeByKeyboard: false,
119122
});
120123
};
121124

@@ -314,11 +317,11 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
314317
$scope.$on('insertParagraph', function(event, paragraphId, position) {
315318
var newIndex = -1;
316319
for (var i=0; i<$scope.note.paragraphs.length; i++) {
317-
if ( $scope.note.paragraphs[i].id === paragraphId ) {
320+
if ( $scope.note.paragraphs[i].id === paragraphId ) {
318321
//determine position of where to add new paragraph; default is below
319-
if ( position === 'above' ) {
322+
if ( position === 'above' ) {
320323
newIndex = i;
321-
} else {
324+
} else {
322325
newIndex = i+1;
323326
}
324327
break;

0 commit comments

Comments
 (0)