// Toolbar save and stay button javascript override bug fix
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<li>
|
||||
<a id="desc-{$table}-{$btn.imgclass|default:$k}" class="toolbar_btn" {if isset($btn.href)}href="{$btn.href}"{/if} title="{$btn.desc}" {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
|
||||
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>
|
||||
<div>{$btn.desc}</div>
|
||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
@@ -57,12 +57,16 @@
|
||||
|
||||
if (btn_save_and_stay.length > 0)
|
||||
{
|
||||
|
||||
//get reference on current save link label
|
||||
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
|
||||
|
||||
//override save and stay link label with submit button value
|
||||
if (btn_submit.val().length > 0)
|
||||
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
||||
{
|
||||
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//hide standard submit button
|
||||
@@ -73,17 +77,17 @@
|
||||
btn_save.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
|
||||
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
if (btn_save_and_stay)
|
||||
{
|
||||
btn_save_and_stay.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
|
||||
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user