From bdf33d885938c4f29c1e4b3198174deb5f3193b6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 31 Jul 2013 16:34:11 +0200 Subject: [PATCH] =?utf8?q?Pflichtenheftkostensch=C3=A4tzung:=20"Abbrechen"?= =?utf8?q?=20ohne=20AJAX-Call=20nur=20in=20JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpec.pm | 13 ++----------- js/requirement_spec.js | 7 ++++++- .../_edit_time_and_cost_estimate.html | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index 75453fbcd..2a6413672 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -109,23 +109,14 @@ sub action_ajax_show_time_and_cost_estimate { $self->render('requirement_spec/_show_time_and_cost_estimate', { layout => 0 }); } -sub action_ajax_cancel_time_and_cost_estimate { - my ($self) = @_; - - my $html = $self->render('requirement_spec/_show_time_and_cost_estimate', { output => 0 }); - - $self->js - ->replaceWith('#time_cost_estimate', $html) - ->render($self); -} - sub action_ajax_edit_time_and_cost_estimate { my ($self) = @_; my $html = $self->render('requirement_spec/_edit_time_and_cost_estimate', { output => 0 }); $self->js - ->replaceWith('#time_cost_estimate', $html) + ->hide('#time_cost_estimate') + ->after('#time_cost_estimate', $html) ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down') ->render($self); } diff --git a/js/requirement_spec.js b/js/requirement_spec.js index b465ce094..d2a50523f 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -326,8 +326,13 @@ ns.standard_basic_settings_ajax_call = function(key, opt) { // ------------------------------------------------------------------------- ns.standard_time_cost_estimate_ajax_call = function(key, opt) { - if ((key == 'cancel') && !confirm(kivi.t8('Do you really want to cancel?'))) + if (key == 'cancel') { + if (confirm(kivi.t8('Do you really want to cancel?'))) { + $('#time_cost_estimate').show(); + $('#time_cost_estimate_form_container').remove(); + } return true; + } var data = "action=RequirementSpec/ajax_" + key + "_time_and_cost_estimate&"; diff --git a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html index 1bd80929a..a18efc09b 100644 --- a/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html +++ b/templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html @@ -1,7 +1,7 @@ [%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE P -%] [%- DEFAULT id_prefix = 'time_and_cost_estimate_form' %] -
+
[%- IF !SELF.requirement_spec.sections.size %]

[%- LxERP.t8("Neither sections nor function blocks have been created yet.") %]

-- 2.39.5