Sfoglia il codice sorgente

[fix] web form and ctrl+enter in quick entry

version-14
Rushabh Mehta 8 anni fa
parent
commit
796f7b0214
2 ha cambiato i file con 9 aggiunte e 7 eliminazioni
  1. +6
    -4
      frappe/public/js/frappe/form/quick_entry.js
  2. +3
    -3
      frappe/templates/generators/web_form.html

+ 6
- 4
frappe/public/js/frappe/form/quick_entry.js Vedi File

@@ -102,10 +102,12 @@ frappe.ui.form.quick_entry = function(doctype, success) {
});

// ctrl+enter to save
dialog.wrapper.keydown("meta+return ctrl+return", function(e) {
if(!frappe.request.ajax_count) {
// not already working -- double entry
dialog.get_primary_btn().trigger("click");
dialog.wrapper.keydown(function(e) {
if((e.ctrlKey || e.metaKey) && e.which==13) {
if(!frappe.request.ajax_count) {
// not already working -- double entry
dialog.get_primary_btn().trigger("click");
}
}
});



+ 3
- 3
frappe/templates/generators/web_form.html Vedi File

@@ -65,7 +65,7 @@

{%- macro value(field, _doc) -%}
{%- if _doc -%}
{%- set _value = _doc.get(field.fieldname) -%}
{%- set _value = _doc.get(field.fieldname) or frappe.form_dict.get(field.fieldname) -%}
{%- else -%}
{%- set _value = frappe.form_dict.get(field.fieldname) or field.default -%}
{%- endif -%}
@@ -85,8 +85,8 @@

{% macro render_field(field, _doc=None, with_label=True) %}
{% if field.hidden %}
<input type="hidden"
name="{{ field.fieldname }}" {% if field.default -%} value="{{ field.default }}" {%- endif %}>
<input type="hidden" data-doctype="{{ field.parent }}"
name="{{ field.fieldname }}" value="{{ value(field, _doc) }}">
{% elif field.fieldtype == "HTML" and field.options %}
<div class="form-group">
{{ field.options }}


Caricamento…
Annulla
Salva