Commit f6fb8ee4 authored by Boris Kocherov's avatar Boris Kocherov

fix jslint

parent 1d9d6f60
......@@ -3,6 +3,7 @@
(function (window, document, rJS, RSVP) {
"use strict";
var render_object;
function decodeJsonPointer(_str) {
// https://tools.ietf.org/html/rfc6901#section-5
......@@ -321,7 +322,7 @@
});
}
function render_object(g, json_field, default_dict, root, path) {
render_object = function (g, json_field, default_dict, root, path) {
var additionalProperties,
key,
required = json_field.required || [],
......@@ -511,7 +512,7 @@
}
}
return queue;
}
};
function getFormValuesAsJSONDict(g) {
var multi_level_dict = {"": {}},
......@@ -656,23 +657,23 @@
})
.declareAcquiredMethod("renameChildrenParent", "renameChildren")
.allowPublicAcquisition("renameChildren", function (opt) {
.allowPublicAcquisition("renameChildren", function (opt_arr, scope) {
var property_name,
objects = this.props.objects,
options = opt[0], // TODO strange rjs behavior
element = getSubGadgetElement(this, options.scope),
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(options.new_name)) {
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] === options.scope) {
if (parent.hasOwnProperty(property_name) && parent[property_name] === scope) {
delete parent[property_name];
parent[options.new_name] = options.scope;
return options.new_name;
parent[new_name] = scope;
return new_name;
}
}
throw new Error("gadget not found for renaming");
......@@ -681,12 +682,7 @@
.declareMethod("rename", function (new_name, event) {
var g = this,
name = g.element.getAttribute('data-json-property-name');
return this.renameChildrenParent({
scope: g.element.getAttribute('data-gadget-scope'),
// parent: g.element.getAttribute('data-json-parent'),
// name: g.element.getAttribute('data-json-property-name'),
new_name: new_name
})
return this.renameChildrenParent(new_name)
.push(function () {
return g.element.setAttribute('data-json-property-name', new_name);
})
......@@ -793,6 +789,7 @@
})
.allowPublicAcquisition("notifyValid", function (arr, sub_scope) {
return true;
})
.allowPublicAcquisition("notifyChange", function (arr, sub_scope) {
var g = this,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment