Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ $xwiki.jsfx.use('js/xwiki/editors/dataeditors.js', true)##
</select>
</div>
<span class="buttonwrapper">
<input type="submit" class="button" value="$services.localization.render('core.editors.class.addProperty.submit')" name="action_propadd"/>
<input type="button" class="button" value="$services.localization.render('core.editors.class.addProperty.submit')" name="action_propadd"/>
</span>
</div>
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,9 @@
$.post(ref).done(function(data) {
$('#xclassContent').append(data);
let insertedPropertyElt = $('#xclassContent > div.xproperty:last-child');
// Expand the newly inserted property, since the user will probably want to edit it once it was added
self.expandCollapseMetaProperty(insertedPropertyElt);
// Make teh newly added property sortable
// Make the newly added property collapsable since the user will probably want to edit it
self.expandCollapseMetaProperty(insertedPropertyElt, true);
// Make the newly added property sortable
self.makeSortable(insertedPropertyElt);
self.ajaxPropertyDeletion(insertedPropertyElt);
self.makeDisableVisible(insertedPropertyElt);
Expand Down Expand Up @@ -683,15 +683,18 @@

// ------------------------------------
// Class editor: expand-collapse meta properties
expandCollapseMetaProperty(property) {
expandCollapseMetaProperty(property, startExpanded = false) {
let propertyTitle = property.find('.xproperty-title');
if (!propertyTitle) {
// No such object...
return;
}
property.addClass('collapsable');
property.addClass('collapsed');
propertyTitle.on('click', function() {
// By default, the property is collapsed when made collapsable.
if(!startExpanded) {
property.addClass('collapsed');
}
propertyTitle.find('.toggle-collapsable, h2').on('click', function() {
propertyTitle.parent().toggleClass('collapsed');
});
}
Expand Down