Skip to content

Commit

Permalink
Set dialog height in CSS not JS. Fixes issue #123
Browse files Browse the repository at this point in the history
Due to a change in Teamcity versions 2018.1.4 and 2018.2 RC, the
WebHookDialog, which extends BS.AbstractModalDialog, was no longer
setting the height correctly.

The JS code would run as part of ShowDialog, and once the dialog is
displayed, would read the height of the last tab and then set the height
of all other tabs to match. This resulted in the tabs all being uniform
height, so the dialog height would remain constant between tabs.

However, with the recent change in teamcity, the dialog was not actually
visible, so the measure phase returned 0. This set the height of the
tabs within the webhook dialog to 0px, and resulted in the text
overlfowing off the bottom of the dialog box.

The actual code to make the dialog visible must be being run after the
ShowDialog method completes now. It's being bound to the ShowDialog
finish event from what I can tell.

The workaround is to use CSS to set the min-height of the four tabs, and
remove the JS code.
  • Loading branch information
netwolfuk committed Dec 2, 2018
1 parent 26049ac commit bfd4d4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ div.endpointPayloadHeaders table tr :first-child {
margin-left: 0px;
}

#hookPane, #buildPane, #extrasPane, #templatePane {
min-height:38em;
}

#buildPane {
overflow:auto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,8 @@ WebHooksPlugin = {

populateWebHookDialog(id);
doExtraCompleted();

if (webhookDialogWidth < 0){
webhookDialogWidth = $j('#editWebHookDialog').innerWidth();
} else {
$j('#editWebHookDialog').innerWidth(webhookDialogWidth);
}

this.showCentered();
$j('#hookPane').innerHeight($j('#templatePane').innerHeight());
$j('#buildPane').innerHeight($j('#templatePane').innerHeight());
$j('#extrasPane').innerHeight($j('#templatePane').innerHeight());
$j('#tab-container').easytabs('select', tab);

if (webhookDialogHeight < 0){
webhookDialogHeight = $j('#editWebHookDialog').innerHeight();
templatePaneOuterHeight = $j('#templatePane').outerHeight();
}

$j('#webHookUrl').focus();
this.showCentered();
},

cleanFields: function (data) {
Expand Down

0 comments on commit bfd4d4c

Please sign in to comment.