// Toolbar improvement
This commit is contained in:
@@ -28,13 +28,13 @@
|
|||||||
{foreach from=$toolbar_btn item=btn key=k}
|
{foreach from=$toolbar_btn item=btn key=k}
|
||||||
{if $k != 'modules-list'}
|
{if $k != 'modules-list'}
|
||||||
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="btn btn-default" {if isset($btn.href)}href="{$btn.href}"{/if} {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
|
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="btn btn-default" {if isset($btn.href)}href="{$btn.href}"{/if} {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
|
||||||
<i class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i> {l s=$btn.desc}
|
<i class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i> <span {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</span>
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
var submited = false
|
var submited = false;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
//get reference on save link
|
//get reference on save link
|
||||||
@@ -49,30 +49,26 @@
|
|||||||
btn_save_and_stay = $('i[class~="process-icon-save-and-stay"]').parent();
|
btn_save_and_stay = $('i[class~="process-icon-save-and-stay"]').parent();
|
||||||
|
|
||||||
//get reference on current save link label
|
//get reference on current save link label
|
||||||
lbl_save = $('#desc-{$table}-save div');
|
lbl_save = $('#desc-{$table}-save');
|
||||||
|
|
||||||
//override save link label with submit button value
|
//override save link label with submit button value
|
||||||
if (btn_submit.val().length > 0)
|
if (btn_submit.html().length > 0)
|
||||||
lbl_save.html(btn_submit.attr("value"));
|
lbl_save.find('span').html(btn_submit.html());
|
||||||
|
|
||||||
if (btn_save_and_stay.length > 0)
|
if (btn_save_and_stay.length > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//get reference on current save link label
|
//get reference on current save link label
|
||||||
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
|
lbl_save_and_stay = $('#desc-{$table}-save-and-stay');
|
||||||
|
|
||||||
//override save and stay link label with submit button value
|
//override save and stay link label with submit button value
|
||||||
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
if (btn_submit.html().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
||||||
{
|
lbl_save_and_stay.find('span').html(btn_submit.html() + " {l s='and stay'} ");
|
||||||
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//hide standard submit button
|
//hide standard submit button
|
||||||
btn_submit.hide();
|
btn_submit.hide();
|
||||||
//bind enter key press to validate form
|
//bind enter key press to validate form
|
||||||
$('#{$table}_form').keypress(function (e) {
|
$('#{$table}_form').find('input').keypress(function (e) {
|
||||||
if (e.which == 13 && e.target.localName != 'textarea')
|
if (e.which == 13 && e.target.localName != 'textarea')
|
||||||
$('#desc-{$table}-save').click();
|
$('#desc-{$table}-save').click();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a id="page-header-desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" 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}>
|
<a id="page-header-desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" 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}>
|
||||||
<i class="{if isset($btn.icon)}{$btn.icon}{else}process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i>
|
<i class="{if isset($btn.icon)}{$btn.icon}{else}process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></i>
|
||||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
<span {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@@ -46,8 +46,9 @@
|
|||||||
|
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
var submited = false
|
var submited = false;
|
||||||
var modules_list_loaded = false;
|
var modules_list_loaded = false;
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
//get reference on save link
|
//get reference on save link
|
||||||
btn_save = $('i[class~="process-icon-save"]').parent();
|
btn_save = $('i[class~="process-icon-save"]').parent();
|
||||||
@@ -61,32 +62,28 @@
|
|||||||
btn_save_and_stay = $('i[class~="process-icon-save-and-stay"]').parent();
|
btn_save_and_stay = $('i[class~="process-icon-save-and-stay"]').parent();
|
||||||
|
|
||||||
//get reference on current save link label
|
//get reference on current save link label
|
||||||
lbl_save = $('#desc-{$table}-save div');
|
lbl_save = $('#page-header-desc-{$table}-save');
|
||||||
|
|
||||||
//override save link label with submit button value
|
//override save link label with submit button value
|
||||||
if (btn_submit.val().length > 0)
|
if (btn_submit.html().length > 0)
|
||||||
lbl_save.html(btn_submit.attr("value"));
|
lbl_save.find('span').html(btn_submit.html());
|
||||||
|
|
||||||
if (btn_save_and_stay.length > 0)
|
if (btn_save_and_stay.length > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//get reference on current save link label
|
//get reference on current save link label
|
||||||
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
|
lbl_save_and_stay = $('#page-header-desc-{$table}-save-and-stay');
|
||||||
|
|
||||||
//override save and stay link label with submit button value
|
//override save and stay link label with submit button value
|
||||||
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
if (btn_submit.html().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
||||||
{
|
lbl_save_and_stay.find('span').html(btn_submit.html() + " {l s='and stay'} ");
|
||||||
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//hide standard submit button
|
//hide standard submit button
|
||||||
btn_submit.hide();
|
btn_submit.hide();
|
||||||
//bind enter key press to validate form
|
//bind enter key press to validate form
|
||||||
$('#{$table}_form').keypress(function (e) {
|
$('#{$table}_form').find('input').keypress(function (e) {
|
||||||
if (e.which == 13 && e.target.localName != 'textarea')
|
if (e.which == 13 && e.target.localName != 'textarea')
|
||||||
$('#desc-{$table}-save').click();
|
$('#page-header-desc-{$table}-save').click();
|
||||||
});
|
});
|
||||||
//submit the form
|
//submit the form
|
||||||
{block name=formSubmit}
|
{block name=formSubmit}
|
||||||
@@ -115,6 +112,7 @@
|
|||||||
}
|
}
|
||||||
{/block}
|
{/block}
|
||||||
}
|
}
|
||||||
|
|
||||||
{if isset($tab_modules_open)}
|
{if isset($tab_modules_open)}
|
||||||
if ({$tab_modules_open})
|
if ({$tab_modules_open})
|
||||||
openModulesList();
|
openModulesList();
|
||||||
|
|||||||
Reference in New Issue
Block a user