fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1768327
)
checkbox for cybernauts + checkbox fix in dialog.js
author
Jan Szejko
<jan.szejko@gmail.com>
Thu, 24 Mar 2016 15:28:41 +0000
(16:28 +0100)
committer
Jan Szejko
<jan.szejko@gmail.com>
Tue, 29 Mar 2016 11:33:34 +0000
(13:33 +0200)
src/editor/entrypoint.js
patch
|
blob
|
history
src/editor/modules/data/data.js
patch
|
blob
|
history
src/editor/views/dialog/dialog.js
patch
|
blob
|
history
src/editor/views/dialog/templates/checkbox.html
patch
|
blob
|
history
diff --git
a/src/editor/entrypoint.js
b/src/editor/entrypoint.js
index
b723517
..
ccc3738
100644
(file)
--- a/
src/editor/entrypoint.js
+++ b/
src/editor/entrypoint.js
@@
-40,8
+40,9
@@
'../../libs/ace/ace': {
exports: 'ace'
},
'../../libs/ace/ace': {
exports: 'ace'
},
- }
+ }
,
+ urlArgs: "bust=" + (new Date()).getTime()
});
requirejs([
});
requirejs([
diff --git
a/src/editor/modules/data/data.js
b/src/editor/modules/data/data.js
index
0d556a2
..
6e8ec93
100644
(file)
--- a/
src/editor/modules/data/data.js
+++ b/
src/editor/modules/data/data.js
@@
-196,6
+196,12
@@
return function(sandbox) {
url: sandbox.getConfig().documentSaveUrl(data.document_id),
data: formData,
success: function(data) {
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);
event.success();
sandbox.publish('savingEnded', 'success', 'remote', data);
diff --git
a/src/editor/views/dialog/dialog.js
b/src/editor/views/dialog/dialog.js
index
7d9f775
..
0e45dd7
100644
(file)
--- a/
src/editor/views/dialog/dialog.js
+++ b/
src/editor/views/dialog/dialog.js
@@
-70,7
+70,10
@@
define(function(require) {
(this.options.fields || []).forEach(function(field) {
var widget = view.$('[name=' + field.name +']');
(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', {
});
this.trigger('execute', {
diff --git
a/src/editor/views/dialog/templates/checkbox.html
b/src/editor/views/dialog/templates/checkbox.html
index
a6ad457
..
8d80d8c
100644
(file)
--- a/
src/editor/views/dialog/templates/checkbox.html
+++ b/
src/editor/views/dialog/templates/checkbox.html
@@
-1,5
+1,7
@@
-<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
<span class="description"><%= description %></span>
</div>
\ No newline at end of file