From: Moritz Bunkus Date: Thu, 10 Nov 2016 12:19:31 +0000 (+0100) Subject: ActionBar: neuer Typ für einfachen Link in Hauptzeile (nicht in Combo) X-Git-Tag: release-3.5.4~1361 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c37fb9ef8fda87c074eb7585c458f1400d326af0;p=kivitendo-erp.git ActionBar: neuer Typ für einfachen Link in Hauptzeile (nicht in Combo) --- diff --git a/SL/Layout/ActionBar.pm b/SL/Layout/ActionBar.pm index a28e1a9fb..b0835c339 100644 --- a/SL/Layout/ActionBar.pm +++ b/SL/Layout/ActionBar.pm @@ -7,6 +7,7 @@ use Carp; use Scalar::Util qw(blessed); use SL::Layout::ActionBar::Action; use SL::Layout::ActionBar::ComboBox; +use SL::Layout::ActionBar::Link; use SL::Layout::ActionBar::Separator; use constant HTML_CLASS => 'layout-actionbar'; @@ -18,6 +19,7 @@ use Rose::Object::MakeMethods::Generic ( my %class_descriptors = ( action => { class => 'SL::Layout::ActionBar::Action', num_params => 1, }, combobox => { class => 'SL::Layout::ActionBar::ComboBox', num_params => 1, }, + link => { class => 'SL::Layout::ActionBar::Link', num_params => 1, }, separator => { class => 'SL::Layout::ActionBar::Separator', num_params => 0, }, ); diff --git a/SL/Layout/ActionBar/Link.pm b/SL/Layout/ActionBar/Link.pm new file mode 100644 index 000000000..49243dec9 --- /dev/null +++ b/SL/Layout/ActionBar/Link.pm @@ -0,0 +1,24 @@ +package SL::Layout::ActionBar::Link; + +use strict; +use parent qw(SL::Layout::ActionBar::Action); + +sub from_params { + my ($class, $data) = @_; + + my ($text, %params) = @$data; + return SL::Layout::ActionBar::Link->new(text => $text, params => \%params); +} + +sub render { + my ($self) = @_; + + return $self->p->html_tag( + 'a', $self->text, + %{ $self->params // {} }, + id => $self->id, + class => 'layout-actionbar-link', + ); +} + +1; diff --git a/css/common.css b/css/common.css index 29d7f6c22..1f1dfcbe0 100644 --- a/css/common.css +++ b/css/common.css @@ -129,6 +129,12 @@ div.layout-actionbar div.layout-actionbar-scriptbutton:hover { border-style: solid; } +div.layout-actionbar .layout-actionbar-link { + margin-left: 6px; + margin-right: 6px; + cursor: default; +} + div.layout-actionbar-combobox { position: relative; display: inline-block;