Commit e6445cea by Chris Dodge

adjust implementation to reflect feedback from Calen. Also limit the jQuery…

adjust implementation to reflect feedback from Calen. Also limit the jQuery selection to be within the metadata-edit region, just to avoid picking up other elements decorated with that attribute
parent a3bf3fb1
...@@ -23,6 +23,6 @@ class CMS.Models.Module extends Backbone.Model ...@@ -23,6 +23,6 @@ class CMS.Models.Module extends Backbone.Model
_metadata = {} _metadata = {}
# walk through the set of elments which have the 'xmetadata_name' attribute and # walk through the set of elments which have the 'xmetadata_name' attribute and
# build up a object to pass back to the server on the subsequent POST # build up a object to pass back to the server on the subsequent POST
_metadata[el.getAttribute("xmetadata_name")]=el.value for el in $('[xmetadata_name]') _metadata[$(el).data("metadata-name")]=el.value for el in $('[data-metadata-name]', @metadata_elt)
@set(metadata: _metadata) @set(metadata: _metadata)
super(args...) super(args...)
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<h3>Metadata</h3> <h3>Metadata</h3>
<ul> <ul>
% for keyname in metadata.keys(): % for keyname in metadata.keys():
<li>${keyname}: <input type='text' xmetadata_name='${keyname}' value='${metadata[keyname]}' size='60' /></li> <li>${keyname}: <input type='text' data-metadata-name='${keyname}' value='${metadata[keyname]}' size='60' /></li>
% endfor % endfor
</ul> </ul>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment