Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
dream
Commits
4e9fdd04
Commit
4e9fdd04
authored
Jan 26, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup fieldset
parent
5bd4883b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
dream/platform/src/fieldset/fieldset.js
dream/platform/src/fieldset/fieldset.js
+3
-17
No files found.
dream/platform/src/fieldset/fieldset.js
View file @
4e9fdd04
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
// Handlebars
// Handlebars
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
// Precompile the templates while loading the first gadget instance
var
i
,
gadget_klass
=
rJS
(
window
),
var
gadget_klass
=
rJS
(
window
),
source
=
gadget_klass
.
__template_element
source
=
gadget_klass
.
__template_element
.
getElementById
(
"
label-template
"
)
.
getElementById
(
"
label-template
"
)
.
innerHTML
,
.
innerHTML
,
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
function
addField
(
property_id
,
property_definition
,
value
)
{
function
addField
(
property_id
,
property_definition
,
value
)
{
var
sub_gadget
;
var
sub_gadget
;
console
.
log
(
"
addField
"
,
property_id
,
property_definition
,
value
);
//
console.log("addField", property_id, property_definition, value);
queue
queue
.
push
(
function
()
{
.
push
(
function
()
{
// XXX this is incorrect for recursive fieldsets.
// XXX this is incorrect for recursive fieldsets.
...
@@ -43,16 +43,6 @@
...
@@ -43,16 +43,6 @@
})
})
);
);
//console.log("PD", property_definition);
if
(
property_definition
.
oneOf
)
{
// if we got a oneOf, then we use the first one that matches our
// data.
console
.
log
(
value
);
for
(
i
=
0
;
i
<
property_definition
.
oneOf
.
length
;
i
+=
1
)
{
console
.
log
(
property_definition
.
oneOf
[
i
]);
};
}
if
(
property_definition
.
type
===
"
object
"
)
{
if
(
property_definition
.
type
===
"
object
"
)
{
// Create a recursive fieldset for this key.
// Create a recursive fieldset for this key.
return
gadget
.
declareGadget
(
"
../fieldset/index.html
"
);
return
gadget
.
declareGadget
(
"
../fieldset/index.html
"
);
...
@@ -87,7 +77,7 @@
...
@@ -87,7 +77,7 @@
if
(
node_id
)
{
if
(
node_id
)
{
addField
(
'
id
'
,
{
'
type
'
:
'
string
'
},
node_id
);
addField
(
'
id
'
,
{
'
type
'
:
'
string
'
},
node_id
);
}
}
console
.
log
(
options
.
property_definition
);
//
console.log(options.property_definition);
Object
.
keys
(
options
.
property_definition
.
properties
Object
.
keys
(
options
.
property_definition
.
properties
).
forEach
(
function
(
property_name
)
{
).
forEach
(
function
(
property_name
)
{
var
property_definition
=
var
property_definition
=
...
@@ -107,10 +97,6 @@
...
@@ -107,10 +97,6 @@
return
queue
;
return
queue
;
})
})
.
declareMethod
(
"
notifyDataChanged
"
,
function
()
{
console
.
log
(
"
content changed
"
);
})
// getContent of all subfields
// getContent of all subfields
.
declareMethod
(
"
getContent
"
,
function
()
{
.
declareMethod
(
"
getContent
"
,
function
()
{
var
i
,
promise_list
=
[],
gadget
=
this
;
var
i
,
promise_list
=
[],
gadget
=
this
;
...
...
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