From 2659735be5b2254ea2c203e1505281badaaeb297 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 9 Dec 2016 19:46:36 +0100 Subject: [PATCH] Auftrags-Controller: 2. Zeilen beim 1. Klick einklappen, wenn Detailsanzeige an Wenn die Detailanzeige per Voreinstellung immer an war, musste man zweimal zum Einklappen der zweiten Zeile klicken, da das Daten-Attribut "expanded" nicht gesetzt war. --- js/kivi.Order.js | 13 +++++++------ templates/webpages/order/tabs/_row.html | 3 +-- templates/webpages/order/tabs/basic_data.html | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/js/kivi.Order.js b/js/kivi.Order.js index 1ab27bc24..ef16ddce4 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -219,7 +219,7 @@ namespace('kivi.Order', function(ns) { ns.hide_second_row = function(row) { $(row).children().not(':first').hide(); - $(row).data('expanded', false); + $(row).data('expanded', 0); var elt = $(row).find('.expand'); elt.attr('src', "image/expand3.gif"); elt.attr('alt', kivi.t8('Show details')); @@ -228,7 +228,7 @@ namespace('kivi.Order', function(ns) { ns.show_second_row = function(row) { $(row).children().not(':first').show(); - $(row).data('expanded', true); + $(row).data('expanded', 1); var elt = $(row).find('.expand'); elt.attr('src', "image/collapse3.gif"); elt.attr('alt', kivi.t8('Hide details')); @@ -236,7 +236,7 @@ namespace('kivi.Order', function(ns) { }; ns.toggle_second_row = function(row) { - if ($(row).data('expanded') === true) { + if ($(row).data('expanded') == 1) { ns.hide_second_row(row); } else { ns.show_second_row(row); @@ -548,8 +548,8 @@ $(function(){ $('#expand_all').on('click', function(event) { event.preventDefault(); - if ($('#expand_all').data('expanded') === true) { - $('#expand_all').data('expanded', false); + if ($('#expand_all').data('expanded') == 1) { + $('#expand_all').data('expanded', 0); $('#expand_all').attr('src', 'image/expand3.gif'); $('#expand_all').attr('alt', kivi.t8('Show all details')); $('#expand_all').attr('title', kivi.t8('Show all details')); @@ -557,7 +557,7 @@ $(function(){ kivi.Order.hide_second_row(elt); }); } else { - $('#expand_all').data('expanded', true); + $('#expand_all').data('expanded', 1); $('#expand_all').attr('src', "image/collapse3.gif"); $('#expand_all').attr('alt', kivi.t8('Hide all details')); $('#expand_all').attr('title', kivi.t8('Hide all details')); @@ -568,4 +568,5 @@ $(function(){ } return false; }); + }); diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 3e45adc2e..a681dedb1 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -3,8 +3,7 @@ [%- USE LxERP %] [%- USE L %] - - + [%- IF MYCONFIG.show_form_details %] diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 4f4e43ad7..46578ad9c 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -157,7 +157,7 @@ [%- IF MYCONFIG.show_form_details %] - [%- L.img_tag(src="image/collapse3.gif", alt=LxERP.t8('Hide all details'), title=LxERP.t8('Hide all details'), id='expand_all') %] + [%- L.img_tag(src="image/collapse3.gif", alt=LxERP.t8('Hide all details'), title=LxERP.t8('Hide all details'), id='expand_all', "data-expanded"="1") %] [%- ELSE %] [%- L.img_tag(src="image/expand3.gif", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %] [%- END %] -- 2.20.1