Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1249,3 +1249,10 @@ span.superimpose sub {
-moz-box-sizing: border-box;
box-sizing: border-box;
}

/* Print styles - suppress box-shadows for printing */
@media print {
* {
box-shadow: none !important;
}
}
36 changes: 20 additions & 16 deletions src/modules/types/display/template-twig/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ define([
},

getForm() {
return (this.currentForm = this.form.getData(false));
this.currentForm = this.form.getData(false);
return this.currentForm;
},

submitChange(event, noChange) {
if (!event) return;
event = event || { target: {} };
const toSend = {
data: this.getForm(),
Expand Down Expand Up @@ -200,10 +202,10 @@ define([
update: {
value(value, name) {
/*
Convert special DataObjects
(twig does some check depending on the filter used
and the values need to be native)
*/
Convert special DataObjects
(twig does some check depending on the filter used
and the values need to be native)
*/
this._values[name] = DataObject.resurrect(value.get());

this.rerender();
Expand Down Expand Up @@ -234,22 +236,24 @@ define([
.then(() => this.submitChange());
},

// we want to set the values based on an object
// we should take care that the template is maybe not yet there
async form(value, name) {
this.formName = name;
this.formObject = value;
// fill form should execute when the template exists
// It doesn't make sense otherwise
this.hasTemplate.then(() => {
this.fillForm(true);
if (
this.module.getConfigurationCheckbox(
'formOptions',
'rerenderIfFormValueChanges',
)
) {
this.rerender();
}
});
await this.hasTemplate;

this.fillForm(true);
if (
this.module.getConfigurationCheckbox(
'formOptions',
'rerenderIfFormValueChanges',
)
) {
this.rerender();
}
},

style(value) {
Expand Down
1 change: 1 addition & 0 deletions src/src/util/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define(['jquery', 'lodash', 'src/util/debug'], function ($, _, Debug) {
this.bind();
this.changeCb = null;
this.submitCb = null;
this.data = null;
}

// maps each dom input elements to a plain object
Expand Down
1 change: 1 addition & 0 deletions testcase/data/twig-form-timing/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading
Loading