Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
8ec4ff25
Commit
8ec4ff25
authored
Sep 06, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup rename not used code related to property rename feature
parent
3a2763c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
62 deletions
+17
-62
jsonform/gadget_json_generated_form_child.js
jsonform/gadget_json_generated_form_child.js
+17
-62
No files found.
jsonform/gadget_json_generated_form_child.js
View file @
8ec4ff25
...
@@ -861,12 +861,7 @@
...
@@ -861,12 +861,7 @@
div
.
appendChild
(
delete_button
);
div
.
appendChild
(
delete_button
);
}
}
}
}
if
(
false
)
{
// XXX;
label
=
document
.
createElement
(
"
input
"
);
label
.
value
=
key
;
gadget
.
props
.
property_name_edit
=
label
;
}
else
{
label_text
=
[
key
,
json_field
.
title
]
label_text
=
[
key
,
json_field
.
title
]
.
filter
(
function
(
v
)
{
return
v
;
})
.
filter
(
function
(
v
)
{
return
v
;
})
.
join
(
"
"
)
.
join
(
"
"
)
...
@@ -884,7 +879,7 @@
...
@@ -884,7 +879,7 @@
}
}
}
}
}
div_input
=
document
.
createElement
(
"
div
"
);
div_input
=
document
.
createElement
(
"
div
"
);
div_input
.
setAttribute
(
"
id
"
,
gadget
.
element
.
getAttribute
(
"
data-gadget-scope
"
)
+
first_path
+
'
/
'
);
div_input
.
setAttribute
(
"
id
"
,
gadget
.
element
.
getAttribute
(
"
data-gadget-scope
"
)
+
first_path
+
'
/
'
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
div_input
.
setAttribute
(
"
class
"
,
"
input
"
);
...
@@ -1603,42 +1598,6 @@
...
@@ -1603,42 +1598,6 @@
g
.
options
=
{};
g
.
options
=
{};
})
})
.
declareAcquiredMethod
(
"
rootNotifyChange
"
,
"
rootNotifyChange
"
)
.
declareAcquiredMethod
(
"
rootNotifyChange
"
,
"
rootNotifyChange
"
)
.
declareAcquiredMethod
(
"
renameChildrenParent
"
,
"
renameChildren
"
)
.
allowPublicAcquisition
(
"
renameChildren
"
,
function
(
opt_arr
,
scope
)
{
var
property_name
,
objects
=
this
.
props
.
objects
,
new_name
=
opt_arr
[
0
],
element
=
getSubGadgetElement
(
this
,
scope
),
parent
=
element
.
getAttribute
(
'
data-json-parent
'
);
if
(
objects
.
hasOwnProperty
(
parent
))
{
parent
=
objects
[
parent
];
if
(
parent
.
hasOwnProperty
(
new_name
))
{
throw
new
Error
(
"
property already exist
"
);
}
// XXX validate property if property pattern
for
(
property_name
in
parent
)
{
if
(
parent
.
hasOwnProperty
(
property_name
)
&&
parent
[
property_name
]
===
scope
)
{
delete
parent
[
property_name
];
parent
[
new_name
]
=
scope
;
return
new_name
;
}
}
throw
new
Error
(
"
gadget not found for renaming
"
);
}
})
.
declareMethod
(
"
rename
"
,
function
(
new_name
,
event
)
{
var
g
=
this
,
name
=
g
.
element
.
getAttribute
(
'
data-json-property-name
'
);
return
this
.
renameChildrenParent
(
new_name
)
.
push
(
function
()
{
return
g
.
element
.
setAttribute
(
'
data-json-property-name
'
,
new_name
);
})
.
push
(
undefined
,
function
()
{
// XXX notify user
event
.
srcElement
.
value
=
name
;
event
.
srcElement
.
focus
();
});
})
.
declareAcquiredMethod
(
"
selfRemove
"
,
"
deleteChildren
"
)
.
declareAcquiredMethod
(
"
selfRemove
"
,
"
deleteChildren
"
)
.
allowPublicAcquisition
(
"
deleteChildren
"
,
function
(
arr
,
scope
)
{
.
allowPublicAcquisition
(
"
deleteChildren
"
,
function
(
arr
,
scope
)
{
var
g
=
this
,
var
g
=
this
,
...
@@ -1860,10 +1819,6 @@
...
@@ -1860,10 +1819,6 @@
})
})
.
onEvent
(
'
input
'
,
function
(
evt
)
{
.
onEvent
(
'
input
'
,
function
(
evt
)
{
if
(
evt
.
target
===
this
.
props
.
property_name_edit
)
{
return
this
.
rename
(
this
.
props
.
property_name_edit
.
value
,
evt
);
}
var
gadget
=
this
,
var
gadget
=
this
,
field_list
=
this
.
props
.
inputs
,
field_list
=
this
.
props
.
inputs
,
i
,
i
,
...
...
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