Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
142
Merge Requests
142
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d53e85dd
Commit
d53e85dd
authored
Oct 19, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: prevent submitting comment twice [WIP]
parent
28c07be4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.js
...dule/gadget_supportrequest_pt_form_view_discussable_js.js
+18
-6
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.xml
...ule/gadget_supportrequest_pt_form_view_discussable_js.xml
+1
-1
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.js
View file @
d53e85dd
...
...
@@ -218,8 +218,11 @@
submitButton
=
gadget
.
element
.
querySelector
(
"
input[type=submit]
"
);
submitButton
.
disabled
=
true
;
submitButton
.
classList
.
add
(
"
ui-disabled
"
);
function
enableSubmitButton
()
{
submitButton
.
disabled
=
false
;
submitButton
.
classList
.
remove
(
"
ui-disabled
"
);
}
queue
=
gadget
.
notifySubmitted
({
message
:
"
Posting comment
"
})
.
push
(
function
()
{
...
...
@@ -231,6 +234,10 @@
data
.
append
(
"
predecessor
"
,
''
);
data
.
append
(
"
data
"
,
content
.
comment
);
data
.
append
(
"
file
"
,
file_blob
);
// reset the file upload, otherwise next comment would upload same file again
choose_file_html_element
.
value
=
""
;
// XXX: Hack, call jIO.util.ajax directly to pass the file blob
// Because the jio_putAttachment will call readBlobAsText, which
// will broke the binary file. Call the jIO.util.ajax directly
...
...
@@ -248,12 +255,17 @@
return
gadget
.
notifySubmitted
({
message
:
"
Comment added
"
,
status
:
"
success
"
});
})
.
push
(
function
()
{
editor
.
changeState
({
value
:
''
})
.
push
(
function
()
{
return
gadget
.
redirect
({
command
:
'
reload
'
});
});
});
queue
.
push
(
enableSubmitButton
,
enableSubmitButton
);
// XXX workaround ... because previous state before user start typing was ""
// we first set to "something" to be able to reset to nothing later.
return
editor
.
changeState
({
value
:
'
'
});
})
.
push
(
function
()
{
return
editor
.
changeState
({
value
:
''
});
})
.
push
(
function
()
{
return
gadget
.
redirect
({
command
:
'
reload
'
});
})
.
push
(
enableSubmitButton
,
enableSubmitButton
);
return
queue
;
});
})
...
...
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.xml
View file @
d53e85dd
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
15399
39405.65
</float>
<float>
15399
46621.33
</float>
<string>
GMT+9
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment