'../../libs/ace/ace': {
exports: 'ace'
},
- }
+ },
+ urlArgs: "bust=" + (new Date()).getTime()
});
requirejs([
url: sandbox.getConfig().documentSaveUrl(data.document_id),
data: formData,
success: function(data) {
+ // ugly!
+ $.each(sandbox.getConfig().documentSaveForm.fields, function(i, field) {
+ if (field.name.indexOf('for_cybernauts') !== -1) {
+ field.checked = event.formData['textsave-for_cybernauts'] === 'on';
+ }
+ });
event.success();
sandbox.publish('savingEnded', 'success', 'remote', data);
(this.options.fields || []).forEach(function(field) {
var widget = view.$('[name=' + field.name +']');
- formData[field.name] = widget.val();
+ var widget_type = widget.attr('type');
+ if (!(widget_type == 'checkbox' || widget_type == 'radio') || widget.is(':checked')) {
+ formData[field.name] = widget.val();
+ }
});
this.trigger('execute', {
-<div>
- <div style="float: left; width:100px;"><%= label %>:</div>
- <input type="checkbox" name="<%= name %>"/>
+<div style="vertical-align: top">
+ <label style="display: inline-block;">
+ <span style="display: inline-block; width:100px;"><%= label %>:</span>
+ <input type="checkbox" name="<%= name %>" <% if (checked) print('checked="checked"'); %>/>
+ </label>
<span class="description"><%= description %></span>
</div>
\ No newline at end of file