Nav close button alignment and nav boxes improved

This commit is contained in:
Simounet 2017-12-28 22:54:42 +01:00 committed by Nicolas Lœuillet
parent 63771b9ae3
commit 2831e77cce
8 changed files with 71 additions and 83 deletions

View file

@ -2,8 +2,7 @@
/* ========================================================================== /* ==========================================================================
Nav Nav
========================================================================== */ ========================================================================== */
nav, nav {
.nav-wrapper {
height: auto; height: auto;
line-height: initial; line-height: initial;
} }
@ -18,25 +17,25 @@ nav {
} }
} }
.nav-wrapper { .nav-panel-item .button-collapse {
margin-left: 0;
margin-right: 0.5rem;
padding: 0 0.5rem;
height: auto;
line-height: 1;
background-color: transparent;
border: none;
}
.nav-panel-item {
display: flex; display: flex;
padding: 0.6rem 0.4rem 0.6rem 0.75rem; padding: 0.6rem 0.4rem 0.6rem 0.75rem;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.button-collapse {
margin-left: 0;
margin-right: 0.5rem;
padding: 0 0.5rem;
height: auto;
line-height: 1;
background-color: transparent;
border: none;
}
} }
nav .nav-wrapper i { .nav-panel-item .material-icons {
height: 46px; height: 46px;
line-height: 46px; line-height: 46px;
} }
@ -51,8 +50,8 @@ nav .nav-wrapper i {
justify-content: flex-end; justify-content: flex-end;
} }
.nav-panel-add .add, .nav-panel-item .add,
.nav-panel-search .search, .nav-panel-item .search,
.nav-panels .close { .nav-panels .close {
color: #444 !important; color: #444 !important;
} }
@ -68,7 +67,6 @@ nav .nav-wrapper i {
.input-field input { .input-field input {
display: block; display: block;
line-height: inherit; line-height: inherit;
width: calc(100% - 8rem);
height: 3rem; height: 3rem;
} }
@ -86,39 +84,32 @@ nav .nav-wrapper i {
} }
.input-field { .input-field {
&.nav-panel-add label, &.nav-panel-item label {
&.nav-panel-search label {
left: 1rem; left: 1rem;
} }
&.nav-panel-add .close, &.nav-panel-item .close {
&.nav-panel-search .close {
position: absolute;
top: 0;
right: 1rem;
color: transparent; color: transparent;
cursor: pointer; cursor: pointer;
font-size: 2rem; font-size: 2rem;
transition: 0.3s color; transition: 0.3s color;
} }
&.nav-panel-add, &.nav-panel-item {
&.nav-panel-add form,
&.nav-panel-search,
&.nav-panel-search form {
display: flex; display: flex;
flex: 1; flex: 1;
flex-wrap: nowrap;
align-items: center; align-items: center;
} }
&.nav-panel-add form.disabled, &.nav-panel-add.disabled,
&.nav-panel-add form.disabled input { &.nav-panel-add.disabled input {
background-color: whitesmoke; background-color: whitesmoke;
} }
} }
.nav-form-button { .nav-form-button {
padding: 0 1rem; padding: 0;
background-color: transparent; background-color: transparent;
border: none; border: none;
@ -127,6 +118,11 @@ nav .nav-wrapper i {
} }
} }
.nav-form-button,
.nav-panel-item .close {
margin: 0 1%;
}
#button_filters { #button_filters {
display: none; display: none;
} }

View file

@ -42,24 +42,20 @@ $(document).ready(() => {
return false; return false;
}); });
$('#nav-btn-add').on('click', () => { $('#nav-btn-add').on('click', () => {
$('.nav-panel-buttom').hide(100); $('.nav-panel-actions').hide(100);
$('.nav-panel-add').show(100); $('.nav-panel-add').show(100);
$('.nav-panels .action').hide(100);
$('.nav-panel-menu').addClass('hidden');
$('.nav-panels').css('background', 'white'); $('.nav-panels').css('background', 'white');
$('#entry_url').focus(); $('#entry_url').focus();
return false; return false;
}); });
const materialAddForm = $('.nav-panel-add form[name=entry]'); const materialAddForm = $('.nav-panel-add');
materialAddForm.on('submit', () => { materialAddForm.on('submit', () => {
materialAddForm.addClass('disabled'); materialAddForm.addClass('disabled');
$('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur'); $('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur');
}); });
$('#nav-btn-search').on('click', () => { $('#nav-btn-search').on('click', () => {
$('.nav-panel-buttom').hide(100); $('.nav-panel-actions').hide(100);
$('.nav-panel-search').show(100); $('.nav-panel-search').show(100);
$('.nav-panels .action').hide(100);
$('.nav-panel-menu').addClass('hidden');
$('.nav-panels').css('background', 'white'); $('.nav-panels').css('background', 'white');
$('#search_entry_term').focus(); $('#search_entry_term').focus();
return false; return false;
@ -67,9 +63,7 @@ $(document).ready(() => {
$('.close').on('click', () => { $('.close').on('click', () => {
$('.nav-panel-add').hide(100); $('.nav-panel-add').hide(100);
$('.nav-panel-search').hide(100); $('.nav-panel-search').hide(100);
$('.nav-panel-buttom').show(100); $('.nav-panel-actions').show(100);
$('.nav-panels .action').show(100);
$('.nav-panel-menu').removeClass('hidden');
$('.nav-panels').css('background', 'transparent'); $('.nav-panels').css('background', 'transparent');
return false; return false;
}); });

View file

@ -9,7 +9,7 @@
<div class="determinate"></div> <div class="determinate"></div>
</div> </div>
<nav class="hide-on-large-only"> <nav class="hide-on-large-only">
<div class="nav-wrapper cyan darken-1"> <div class="nav-panel-item cyan darken-1">
<ul> <ul>
<li> <li>
<a href="#" data-activates="slide-out" class="button-collapse"> <a href="#" data-activates="slide-out" class="button-collapse">

View file

@ -1,4 +1,4 @@
<form name="entry" method="post" action="{{ path('new_entry')}}"> <form class="input-field nav-panel-item nav-panel-add" style="display: none" name="entry" method="post" action="{{ path('new_entry')}}">
{% if form_errors(form) %} {% if form_errors(form) %}
<span class="black-text">{{ form_errors(form) }}</span> <span class="black-text">{{ form_errors(form) }}</span>
{% endif %} {% endif %}
@ -9,6 +9,7 @@
{% endif %} {% endif %}
{{ form_widget(form.url, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.new.placeholder'} }) }} {{ form_widget(form.url, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.new.placeholder'} }) }}
<i class="material-icons close">clear</i>
{{ form_rest(form) }} {{ form_rest(form) }}
</form> </form>

View file

@ -1,4 +1,4 @@
<form name="search" method="GET" action="{{ path('search')}}"> <form class="input-field nav-panel-item nav-panel-search" style="display: none" name="search" method="GET" action="{{ path('search')}}">
{% if form_errors(form) %} {% if form_errors(form) %}
<span class="black-text">{{ form_errors(form) }}</span> <span class="black-text">{{ form_errors(form) }}</span>
{% endif %} {% endif %}
@ -11,6 +11,7 @@
<input type="hidden" name="currentRoute" value="{{ currentRoute }}" /> <input type="hidden" name="currentRoute" value="{{ currentRoute }}" />
{{ form_widget(form.term, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.search.placeholder'} }) }} {{ form_widget(form.term, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.search.placeholder'} }) }}
<i class="material-icons close">clear</i>
{{ form_rest(form) }} {{ form_rest(form) }}
</form> </form>

View file

@ -93,44 +93,40 @@
<a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a> <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
</li> </li>
</ul> </ul>
<div class="nav-wrapper nav-panels"> <div class="nav-panels">
<div class="nav-panel-top"> <div class="nav-panel-actions nav-panel-item">
<button data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></button> <div class="nav-panel-top">
<h1 class="left action"> <button data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></button>
{% block title %} <h1 class="left action">
{% endblock %} {% block title %}
</h1> {% endblock %}
</div> </h1>
<ul class="input-field nav-panel-buttom"> </div>
<li class="bold"> <ul class="input-field nav-panel-buttom">
<a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.add_new_entry'|trans }}" href="{{ path('new') }}" id="nav-btn-add"> <li class="bold">
<i class="material-icons">add</i> <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.add_new_entry'|trans }}" href="{{ path('new') }}" id="nav-btn-add">
</a> <i class="material-icons">add</i>
</li> </a>
<li> </li>
<a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.search'|trans }}" href="javascript: void(null);" id="nav-btn-search"> <li>
<i class="material-icons">search</i> <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.search'|trans }}" href="javascript: void(null);" id="nav-btn-search">
</a> <i class="material-icons">search</i>
</li> </a>
<li id="button_filters"> </li>
<a class="nav-panel-menu button-collapse-right tooltipped js-filters-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters"> <li id="button_filters">
<i class="material-icons">filter_list</i> <a class="nav-panel-menu button-collapse-right tooltipped js-filters-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters">
</a> <i class="material-icons">filter_list</i>
</li> </a>
<li id="button_export"> </li>
<a class="nav-panel-menu button-collapse-right tooltipped js-export-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.export'|trans }}" href="#" data-activates="export"> <li id="button_export">
<i class="material-icons">file_download</i> <a class="nav-panel-menu button-collapse-right tooltipped js-export-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.export'|trans }}" href="#" data-activates="export">
</a> <i class="material-icons">file_download</i>
</li> </a>
</ul> </li>
<div class="input-field nav-panel-search" style="display: none"> </ul>
{{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
<i class="material-icons close">clear</i>
</div>
<div class="input-field nav-panel-add" style="display: none">
{{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
<i class="material-icons close">clear</i>
</div> </div>
{{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
{{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
</div> </div>
</nav> </nav>
{% endblock %} {% endblock %}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long