Skip to content

Commit

Permalink
Pequeñas correcciones al js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos García Gómez committed Nov 30, 2021
1 parent 8c8275d commit f36bd7b
Showing 1 changed file with 35 additions and 27 deletions.
62 changes: 35 additions & 27 deletions Core/View/Master/ListController.html.twig
@@ -1,21 +1,21 @@
{#
/**
* This file is part of FacturaScripts
* Copyright (C) 2017-2020 Carlos Garcia Gomez <carlos@facturascripts.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
/**
* This file is part of FacturaScripts
* Copyright (C) 2017-2021 Carlos Garcia Gomez <carlos@facturascripts.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
#}
{% extends "Master/MenuTemplate.html.twig" %}

Expand All @@ -40,28 +40,33 @@
</ol>
</nav>
<div class="btn-group bg-white">
<a class="btn btn-sm btn-outline-secondary" href="{{ fsc.url() }}" title="{{ i18n.trans('refresh') }}">
<a class="btn btn-sm btn-outline-secondary" href="{{ fsc.url() }}"
title="{{ i18n.trans('refresh') }}">
<i class="fas fa-redo" aria-hidden="true"></i>
</a>
{% if pageData.name == fsc.user.homepage %}
<a class="btn btn-sm btn-outline-secondary active" href="{{ fsc.url() }}?defaultPage=FALSE" title="{{ i18n.trans('marked-as-homepage') }}">
<a class="btn btn-sm btn-outline-secondary active" href="{{ fsc.url() }}?defaultPage=FALSE"
title="{{ i18n.trans('marked-as-homepage') }}">
<i class="fas fa-bookmark" aria-hidden="true"></i>
</a>
{% else %}
<a class="btn btn-sm btn-outline-secondary" href="{{ fsc.url() }}?defaultPage=TRUE" title="{{ i18n.trans('mark-as-homepage') }}">
<a class="btn btn-sm btn-outline-secondary" href="{{ fsc.url() }}?defaultPage=TRUE"
title="{{ i18n.trans('mark-as-homepage') }}">
<i class="fas fa-bookmark" aria-hidden="true"></i>
</a>
{% endif %}
</div>
{# -- Options button -- #}
<div class="btn-group">
<div class="dropdown">
<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="fas fa-wrench fa-fw" aria-hidden="true"></i> {{ i18n.trans('options') }}
</button>
<div class="dropdown-menu">
{% for viewName, view in fsc.views %}
<a class="dropdown-item" href="EditPageOption?code={{ viewName }}&url={{ view.model.url() | url_encode }}">
<a class="dropdown-item"
href="EditPageOption?code={{ viewName }}&url={{ view.model.url() | url_encode }}">
<i class="{{ view.icon }} fa-fw" aria-hidden="true"></i> {{ view.title }}
</a>
{% endfor %}
Expand All @@ -82,10 +87,13 @@
{% for viewName, view in fsc.views %}
<li class="nav-item">
{% set active = (viewName == fsc.active) ? ' active' : '' %}
<a href="#{{ viewName }}" class="nav-link{{ active }}" data-toggle="tab" role="tab" aria-controls="{{ viewName }}">
<a href="#{{ viewName }}" class="nav-link{{ active }}" data-toggle="tab" role="tab"
aria-controls="{{ viewName }}">
<i class="{{ view.icon }} fa-fw" aria-hidden="true"></i>
<span class="d-none d-sm-inline-block">{{ view.title }}</span>
{% if view.count > 0 %}<span class="badge badge-secondary">{{ fsc.toolBox().numbers().format(view.count, 0) }}</span>{% endif %}
{% if view.count > 0 %}
<span class="badge badge-secondary">{{ fsc.toolBox().numbers().format(view.count, 0) }}</span>
{% endif %}
</a>
</li>
{% endfor %}
Expand Down Expand Up @@ -122,6 +130,9 @@
if (document.location.hash) {
$(".nav-tabs a[href=\\" + document.location.hash + "]").tab('show');
}
if (window.innerWidth > 1023) {
$("input[name='query']:visible").focus();
}
$('.nav-tabs a').click(function (e) {
$(this).tab('show');
var scrollmem = $('body').scrollTop();
Expand All @@ -133,9 +144,6 @@
$("input[name='query']:visible").focus();
}
});
if (window.innerWidth > 1023) {
$("input[name='query']:visible").focus();
}
});
</script>
{% endblock %}

0 comments on commit f36bd7b

Please sign in to comment.