* prevent showing message on first submit button, bug #36535.
This commit is contained in:
@@ -310,7 +310,7 @@ class ai extends control
|
||||
if(!empty($data->goTesting)) // Go to testing object view.
|
||||
{
|
||||
$location = $this->ai->getTestingLocation($prompt);
|
||||
return $this->send(empty($location) ? array('result' => 'fail', 'message' => $this->lang->ai->prompts->goingTestingFail) : array('result' => 'success', 'message' => $this->lang->ai->prompts->goingTesting, 'locate' => $location));
|
||||
return $this->send(empty($location) ? array('result' => 'fail', 'target' => '#go-test-btn', 'msg' => $this->lang->ai->prompts->goingTestingFail) : array('result' => 'success', 'target' => '#go-test-btn', 'msg' => $this->lang->ai->prompts->goingTesting, 'locate' => $location));
|
||||
}
|
||||
|
||||
if($isJumpToNext)
|
||||
|
||||
@@ -147,6 +147,28 @@ $(function()
|
||||
|
||||
/* Enable buttons after going testing. */
|
||||
$('#mainForm').ajaxForm({
|
||||
success: function(response, status)
|
||||
{
|
||||
var message = response.msg;
|
||||
var location = response.locate;
|
||||
var target = response.target ? response.target : '#submit';
|
||||
if(message)
|
||||
{
|
||||
var $targetSubmitBtn = $(target);
|
||||
if($targetSubmitBtn.length)
|
||||
{
|
||||
$targetSubmitBtn.popover({
|
||||
container: 'body',
|
||||
trigger: 'manual',
|
||||
content: message,
|
||||
tipClass: 'popover-in-modal popover-success popover-form-result',
|
||||
placement: 'right',
|
||||
}).popover('show');
|
||||
setTimeout(function() {$targetSubmitBtn.popover('destroy');}, 2000);
|
||||
}
|
||||
}
|
||||
if(location) setTimeout(function() {$.apps.open(location);}, 1200);
|
||||
},
|
||||
finish: function(response, _, $form)
|
||||
{
|
||||
if(response.locate) setTimeout(function() {$.apps.open(response.locate);}, 1200);
|
||||
|
||||
Reference in New Issue
Block a user