Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
fccdd0f3
Commit
fccdd0f3
authored
May 16, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to give something else than a form, this surely break compatibilty
parent
54e421ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
poc/renderjs/js/renderjs.js
poc/renderjs/js/renderjs.js
+13
-6
No files found.
poc/renderjs/js/renderjs.js
View file @
fccdd0f3
...
...
@@ -110,20 +110,27 @@ var TabbularGadget = {
visible_dom
.
removeClass
(
"
not_selected
"
);
},
addNewTabGadget
:
function
(
form_id
,
dom_id
,
gadget_data_handler
)
{
addNewTabGadget
:
function
(
gadget_url
,
dom_id
,
gadget_data_handler
)
{
// add new gadget and render it
var
html_string
;
var
html_string_array
;
tab_container
=
$
(
'
#
'
+
dom_id
);
tab_container
.
empty
();
// XXX: allow add any gadget,gadget:source items within API
html_string
=
[
'
<div class="gadget"
'
,
'
gadget="
'
+
form_id
+
'
/Form_asRenderJSGadget"
'
,
'
gadget:data-handler="
'
+
gadget_data_handler
+
'
"
'
,
'
gadget:data-source="Form_asJSON?form_id=
'
+
form_id
+
'
"></div>
'
].
join
(
'
\n
'
);
html_string_array
=
[
'
<div class="gadget"
'
,
'
gadget="
'
+
gadget_url
+
'
"
'
]
if
(
gadget_data_handler
!==
undefined
)
{
html_string_array
.
push
(
'
gadget:data-handler="
'
+
gadget_data_handler
+
'
"
'
);
html_string_array
.
push
(
'
gadget:data-source="Form_asJSON?form_id=
'
+
form_id
+
'
">
'
);
}
html_string_array
.
push
(
'
</div>
'
)
html_string
=
html_string_array
.
join
(
'
\n
'
);
tab_container
.
append
(
html_string
);
tab_gadget
=
tab_container
.
find
(
"
.gadget
"
);
Form
.
setCurrentFormId
(
form_id
);
//The above line sounds not generic enough
//Form.setCurrentFormId(form_id);
// render new gadget
is_ready
=
false
;
...
...
Write
Preview
Markdown
is supported
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