Skip to content
Permalink
Browse files

Make sure nav toolbar stays the same size

  • Loading branch information...
flack committed Mar 4, 2019
1 parent 886fb9b commit 377d75901543ea9ab99f233ea09c245f1d99fdef
Showing with 26 additions and 14 deletions.
  1. +18 −12 lib/org/openpsa/invoices/handler.php
  2. +8 −2 themes/OpenPsa2/static/style.css
@@ -71,6 +71,7 @@ public function prepare_toolbar($show_backlink = true)
public function add_next_previous(org_openpsa_invoices_invoice_dba $object, $urlprefix)
{
$items = [];
$url = '';
if ($object->number > 1) {
$mc = org_openpsa_invoices_invoice_dba::new_collector();
$mc->add_constraint('number', '<', $object->number);
@@ -79,15 +80,18 @@ public function add_next_previous(org_openpsa_invoices_invoice_dba $object, $url
$results = $mc->list_keys();
if (!empty($results)) {
$items[] = [
MIDCOM_TOOLBAR_URL => $urlprefix . key($results) . '/',
MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('previous'),
MIDCOM_TOOLBAR_GLYPHICON => 'chevron-left',
MIDCOM_TOOLBAR_ACCESSKEY => 'p',
];
$url = $urlprefix . key($results) . '/';
}
}
$items[] = [
MIDCOM_TOOLBAR_URL => $url,
MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('previous'),
MIDCOM_TOOLBAR_GLYPHICON => 'chevron-left',
MIDCOM_TOOLBAR_ACCESSKEY => 'p',
MIDCOM_TOOLBAR_ENABLED => !empty($url)
];
$url = '';
if (($object->number + 1) < $object->generate_invoice_number()) {
$mc = org_openpsa_invoices_invoice_dba::new_collector();
$mc->add_constraint('number', '>', $object->number);
@@ -96,14 +100,16 @@ public function add_next_previous(org_openpsa_invoices_invoice_dba $object, $url
$results = $mc->list_keys();
if (!empty($results)) {
$items[] = [
MIDCOM_TOOLBAR_URL => $urlprefix . key($results) . '/',
MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('next'),
MIDCOM_TOOLBAR_GLYPHICON => 'chevron-right',
MIDCOM_TOOLBAR_ACCESSKEY => 'n',
];
$url = $urlprefix . key($results) . '/';
}
}
$items[] = [
MIDCOM_TOOLBAR_URL => $url,
MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('next'),
MIDCOM_TOOLBAR_GLYPHICON => 'chevron-right',
MIDCOM_TOOLBAR_ACCESSKEY => 'n',
MIDCOM_TOOLBAR_ENABLED => !empty($url)
];
org_openpsa_widgets_ui::add_navigation_toolbar($items);
}
}
@@ -524,6 +524,10 @@ input#org_openpsa_search_query
padding-right: 1.2em;
}

#org_openpsa_toolbar ul.navigation_toolbar li.disabled
{
opacity: .5
}

.org_openpsa_toolbar ul.midcom_toolbar li
{
@@ -539,6 +543,7 @@ input#org_openpsa_search_query
}

.org_openpsa_toolbar ul.midcom_toolbar li > a,
.org_openpsa_toolbar ul.midcom_toolbar li.disabled > abbr,
.org_openpsa_toolbar ul.midcom_toolbar li button
{
display: inline-block;
@@ -551,7 +556,8 @@ input#org_openpsa_search_query
line-height: 16px;
}

#container .org_openpsa_toolbar ul.midcom_toolbar li > a
#container .org_openpsa_toolbar ul.midcom_toolbar li > a,
#container .org_openpsa_toolbar ul.midcom_toolbar li.disabled > abbr
{
text-decoration: none !important;
}
@@ -603,7 +609,7 @@ input#org_openpsa_search_query
padding-left: 3px
}

.org_openpsa_toolbar ul.midcom_toolbar li.disabled
.org_openpsa_toolbar ul.view_toolbar li.disabled
{
display: none;
}

0 comments on commit 377d759

Please sign in to comment.
You can’t perform that action at this time.