Skip to content

Commit

Permalink
Установка описания версии. Fix нажатия Enter при заполнении формы
Browse files Browse the repository at this point in the history
  • Loading branch information
sokolovsky committed Aug 3, 2015
1 parent 8a0b7f9 commit 6b282ba
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion admin/changeversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
$form->EndCustomField('owner');
$form->Buttons();
$form->Show();
CJSCore::Init(array('jquery'));
$jsParams = array(
'owner' => array(
'label' => $localization->getDataByPath('owner'),
Expand Down Expand Up @@ -103,15 +104,24 @@

var dialog = new BX.CDialog({
'title': params.dialog.title,
'content': '<form><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="40%" text-align="right">'+params.owner.label+':</td><td width="60%" align="left"><input type="text" id="owner" name="ownersetup[owner]" value="'+params.owner.value+'"></td></tr></table></form>',
'content': '<form id="ownerSetupLinkForm"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="40%" text-align="right">'+params.owner.label+':</td><td width="60%" align="left"><input type="text" id="owner" name="ownersetup[owner]" value="'+params.owner.value+'"></td></tr></table></form>',
'width': 500,
'height': 70,
'buttons': [save, BX.CAdminDialog.btnCancel],
'resizable': false
});

var useFormHandler = false;
$ownerLink.click(function (e) {
e.preventDefault();
dialog.Show();
if (!useFormHandler) {
$('#ownerSetupLinkForm').submit(function (e) {
e.preventDefault();
save.action();
});
useFormHandler = true;
}
});
});
})(<?=CUtil::PhpToJsObject($jsParams)?>)
Expand Down

0 comments on commit 6b282ba

Please sign in to comment.