From 7328cbd6ab400a613f6c160beffbdb3abb44c8ad Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 11 May 2011 13:22:28 +0200 Subject: [PATCH] Per default Drag&Drop nur auf Item mit Klasse 'dragdrop' zulassen --- SL/Template/Plugin/L.pm | 9 ++++++--- templates/webpages/am/edit_units.html | 2 +- templates/webpages/am/list_price_factors.html | 6 +++++- templates/webpages/am/list_warehouses.html | 2 +- templates/webpages/amcvar/list_cvar_configs.html | 6 +++++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 0d159dc85..b78ebb015 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -438,6 +438,7 @@ JAVASCRIPT JAVASCRIPT } + $params{handle} = '.dragdrop' unless exists $params{handle}; $attributes{handle} = "'$params{handle}'" if $params{handle}; my $attr_str = join(', ', map { "${_}: $attributes{$_}" } keys %attributes); @@ -697,9 +698,11 @@ element (see C<$params{with}>). =item C An optional jQuery selector specifying which part of the child element -is dragable. If nothing is given then the whole child element is -dragable, and clicks through to underlying elements like inputs or -links might not work. +is dragable. If the parameter is not given then it defaults to +C<.dragdrop> matching DOM elements with the class C. If the +parameter is set and empty then the whole child element is dragable, +and clicks through to underlying elements like inputs or links might +not work. =item C diff --git a/templates/webpages/am/edit_units.html b/templates/webpages/am/edit_units.html index 9d228d5da..c9495e14e 100644 --- a/templates/webpages/am/edit_units.html +++ b/templates/webpages/am/edit_units.html @@ -145,7 +145,7 @@ - [% L.sortable_element('#unit_list tbody', 'url' => 'controller.pl?action=Unit/reorder', 'with' => 'unit_id', handle => '.dragdrop') %] + [% L.sortable_element('#unit_list tbody', url => 'controller.pl?action=Unit/reorder', with => 'unit_id') %] diff --git a/templates/webpages/am/list_price_factors.html b/templates/webpages/am/list_price_factors.html index c220a8dd0..0f3c0135c 100644 --- a/templates/webpages/am/list_price_factors.html +++ b/templates/webpages/am/list_price_factors.html @@ -11,12 +11,15 @@

+ + + [% FOREACH factor = PRICE_FACTORS %] @@ -24,6 +27,7 @@ [% END %] +
[ LxERP.t8('reorder item') %] [% 'Description' | $T8 %] [% 'Factor' | $T8 %]
[ LxERP.t8('reorder item') %][% HTML.escape(factor.factor) %]

@@ -38,7 +42,7 @@

- [% L.sortable_element('#price_factor_list tbody', 'url' => 'controller.pl?action=PriceFactor/reorder', 'with' => 'price_factor_id', handle => '.dragdrop') %] + [% L.sortable_element('#price_factor_list tbody', url => 'controller.pl?action=PriceFactor/reorder', with => 'price_factor_id') %] diff --git a/templates/webpages/am/list_warehouses.html b/templates/webpages/am/list_warehouses.html index b791e7de8..d4e0e0f74 100644 --- a/templates/webpages/am/list_warehouses.html +++ b/templates/webpages/am/list_warehouses.html @@ -39,7 +39,7 @@

- [% L.sortable_element('#warehouse_list tbody', 'url' => 'controller.pl?action=Warehouse/reorder', 'with' => 'warehouse_id', handle => '.dragdrop') %] + [% L.sortable_element('#warehouse_list tbody', url => 'controller.pl?action=Warehouse/reorder', with => 'warehouse_id') %] diff --git a/templates/webpages/amcvar/list_cvar_configs.html b/templates/webpages/amcvar/list_cvar_configs.html index b2e4b9ab8..4c76eb66e 100644 --- a/templates/webpages/amcvar/list_cvar_configs.html +++ b/templates/webpages/amcvar/list_cvar_configs.html @@ -25,6 +25,7 @@

+ @@ -36,7 +37,9 @@ [%- END %] + + [%- FOREACH cfg = CONFIGS %] @@ -79,6 +82,7 @@ [%- END %] [%- END %] +
[ LxERP.t8('reorder item') %] [% 'Name' | $T8 %][% 'Editable' | $T8 %]
[ LxERP.t8('reorder item') %]

@@ -89,7 +93,7 @@

- [% L.sortable_element('#cvarcfg_list tbody', 'url' => 'controller.pl?action=CustomVariableConfig/reorder', 'with' => 'cvarcfg_id', handle => '.dragdrop') %] + [% L.sortable_element('#cvarcfg_list tbody', url => 'controller.pl?action=CustomVariableConfig/reorder', with => 'cvarcfg_id') %] -- 2.20.1