Skip to content

Commit

Permalink
Fix JENKINS-33109 by placing logs window to the right of element
Browse files Browse the repository at this point in the history
  • Loading branch information
svanoort committed May 10, 2016
1 parent 7dc4f84 commit 040d395
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ui/src/main/js/view/stage-logs.js
Expand Up @@ -31,7 +31,7 @@ exports.render = function (stageDescription, onElement) {
var stageLogsDom = templates.apply('stage-logs', stageDescription);
var winWidth = $(theWindow).width();
var winHeight = $(theWindow).height();
var dialogWidth = Math.min(800, (winWidth * 0.7));
var dialogWidth = Math.min(800, (winWidth * 0.5));
var dialogHeight = Math.min(800, (winHeight * 0.7));
var nodeLogFrames = $('.node-log-frame', stageLogsDom);
var nodeNameBars = $('.node-name', stageLogsDom);
Expand All @@ -44,6 +44,8 @@ exports.render = function (stageDescription, onElement) {
onElement.on(clickNSEvent, function() {
dialog.show('Stage Logs (' + stageDescription.name + ')', stageLogsDom, {
classes: 'cbwf-stage-logs-dialog',
placement: 'right',
'onElement': onElement,
width: dialogWidth,
height: dialogHeight,
onshow: function() {
Expand Down
9 changes: 8 additions & 1 deletion ui/src/main/js/view/widgets/dialog/index.js
Expand Up @@ -59,7 +59,14 @@ exports.show = function(title, body, options) {
bodyEl.append(body);

options.modal = true;
var popover = popoverWidget.newPopover(title, dialog, undefined, options);
// Undefined for the onElement makes it in the window center
// WE NEED an onElement, but right now this fails
if (options.onElement) {
var popover = popoverWidget.newPopover(title, dialog, options.onElement, options);
} else {
var popover = popoverWidget.newPopover(title, dialog, undefined, options);
}

popover.show();
if (options.onshow) {
options.onshow();
Expand Down

0 comments on commit 040d395

Please sign in to comment.