Pflichtenheftabschätzung: Bei RETURN per AJAX speichern; "Speichern"-Button anzeigen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Jul 2013 11:24:10 +0000 (13:24 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:09:08 +0000 (13:09 +0200)
SL/Controller/RequirementSpec.pm
js/requirement_spec.js
templates/webpages/requirement_spec/_edit_time_and_cost_estimate.html

index 9da08f3..58a0374 100644 (file)
@@ -115,6 +115,7 @@ sub action_ajax_edit_time_and_cost_estimate {
 
   $self->js
    ->replaceWith('#time_cost_estimate', $html)
+   ->on('#time_cost_estimate INPUT[type=text]', 'keydown', 'kivi.requirement_spec.time_cost_estimate_input_key_down')
    ->render($self);
 }
 
index 567f893..cb10246 100644 (file)
@@ -324,6 +324,14 @@ ns.standard_time_cost_estimate_ajax_call = function(key, opt) {
   return true;
 };
 
+ns.time_cost_estimate_input_key_down = function(event) {
+  if(event.keyCode == 13) {
+    event.preventDefault();
+    ns.standard_time_cost_estimate_ajax_call('save');
+    return false;
+  }
+};
+
 // -------------------------------------------------------------------------
 // --------------------------- quotations/orders ---------------------------
 // -------------------------------------------------------------------------
index f0e6831..1bd8092 100644 (file)
@@ -39,6 +39,8 @@
      [%- END -%]
     </tbody>
    </table>
+
+   [% L.button_tag("kivi.requirement_spec.standard_time_cost_estimate_ajax_call('save')", LxERP.t8("Save")) %]
   </form>
  [%- END %]
 </div>