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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
erp5
Commits
0dd02751
Commit
0dd02751
authored
Oct 12, 2017
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_support_request_ui: prevent sending comment twice
on form view discussable, by disabling submit button
parent
75688d10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
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
+14
-2
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_pt_form_view_discussable_js.js
View file @
0dd02751
...
@@ -184,15 +184,22 @@
...
@@ -184,15 +184,22 @@
}
}
});
});
})
})
.
onEvent
(
'
submi
t
'
,
function
()
{
.
declareJob
(
'
submitPostCommen
t
'
,
function
()
{
var
gadget
=
this
,
var
gadget
=
this
,
submitButton
=
null
,
queue
=
null
,
editor
=
gadget
.
element
.
querySelector
(
'
#comment
'
);
editor
=
gadget
.
element
.
querySelector
(
'
#comment
'
);
if
(
editor
.
value
===
''
)
{
if
(
editor
.
value
===
''
)
{
return
gadget
.
notifySubmitted
({
message
:
"
Post content can not be empty!
"
});
return
gadget
.
notifySubmitted
({
message
:
"
Post content can not be empty!
"
});
}
}
return
gadget
.
notifySubmitted
({
message
:
"
Comment added
"
})
submitButton
=
gadget
.
element
.
querySelector
(
"
input[type=submit]
"
);
submitButton
.
disabled
=
true
;
function
enableSubmitButton
()
{
submitButton
.
disabled
=
false
;
}
queue
=
gadget
.
notifySubmitted
({
message
:
"
Posting comment
"
})
.
push
(
function
()
{
.
push
(
function
()
{
var
choose_file_html_element
=
gadget
.
element
.
querySelector
(
'
#attachment
'
),
var
choose_file_html_element
=
gadget
.
element
.
querySelector
(
'
#attachment
'
),
file_blob
=
choose_file_html_element
.
files
[
0
],
file_blob
=
choose_file_html_element
.
files
[
0
],
...
@@ -219,5 +226,10 @@
...
@@ -219,5 +226,10 @@
editor
.
value
=
''
;
editor
.
value
=
''
;
return
gadget
.
redirect
({
command
:
'
reload
'
});
return
gadget
.
redirect
({
command
:
'
reload
'
});
});
});
queue
.
then
(
enableSubmitButton
,
enableSubmitButton
);
return
queue
;
})
.
onEvent
(
'
submit
'
,
function
()
{
this
.
submitPostComment
();
});
});
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
));
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
));
\ No newline at end of file
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