Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHARISM
Shelter Database
Commits
8cef4ecb
Unverified
Commit
8cef4ecb
authored
Jul 19, 2016
by
Cédric Bonhomme
Browse files
Bug fix.
parent
890dcf57
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/web/static/js/edit-shelter.js
View file @
8cef4ecb
...
...
@@ -16,7 +16,8 @@ function update_free_text_value(value_id, value) {
});
}
function
new_free_text_property
(
shelter_id
,
category_id
,
attribute_id
,
value
)
{
function
new_free_text_property
(
shelter_id
,
category_id
,
attribute_id
,
value
,
event_target
)
{
new_property_dict
=
{
"
shelter_id
"
:
shelter_id
,
"
attribute_id
"
:
attribute_id
,
...
...
@@ -35,6 +36,9 @@ function new_free_text_property(shelter_id, category_id, attribute_id, value) {
dataType
:
"
json
"
,
data
:
JSON
.
stringify
(
new_property_dict
),
success
:
function
(
result
)
{
// set the property-id of the input, so that
// new time update_property() will be called (HTTP PUT request)
event_target
.
attr
(
"
value-id
"
,
result
.
id
);
console
.
log
(
result
);
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
){
...
...
src/web/templates/edit.html
View file @
8cef4ecb
...
...
@@ -228,7 +228,8 @@ $(document).ready(function() {
}
else
{
category_id
=
$
(
evt
.
target
).
attr
(
"
category-id
"
);
attribute_id
=
$
(
evt
.
target
).
attr
(
"
attribute-id
"
);
new_free_text_property
({{
shelter
.
id
}},
category_id
,
attribute_id
,
value
);
new_free_text_property
({{
shelter
.
id
}},
category_id
,
attribute_id
,
value
,
$
(
evt
.
target
));
}
});
...
...
Write
Preview
Supports
Markdown
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