未验证 提交 40d18ec3 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #3483 from varyvol/JENKINS-51816

[JENKINS-51816] Avoid the form to be sent when Enter is pressed.
......@@ -103,14 +103,21 @@ THE SOFTWARE.
</table>
</div>
<script>
$('root-url').focus();
var rootUrlField = $('root-url');
rootUrlField.focus();
rootUrlField.onkeydown = function(event) {
if (event.keyCode == 13){
event.preventDefault();
}
};
(function setInitialRootUrlFieldValue(){
var iframeUrl = window.location.href;
// will let the trailing slash in the rootUrl
var iframeRelativeUrl = 'setupWizard/setupWizardConfigureInstance';
var rootUrl = iframeUrl.substr(0, iframeUrl.length - iframeRelativeUrl.length);
// to keep only the root url
var rootUrlField = $('root-url');
rootUrlField.value = rootUrl
// to adjust the width of the input,
rootUrlField.size = Math.min(50, rootUrl.length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册