Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/js/views/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
options = node.getPropertyOptions();
// iterate property of node
for (p in props) {
if (!BWidget.propertyVisible(node.getType(), p)) {
continue;
}
labelVal = node.getPropertyDisplayName(p);
valueId = p+'-value';
valueVal = props[p];
Expand Down
23 changes: 23 additions & 0 deletions src/js/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ var BCommonProperties = {
* 9) validIn: Parent widget in which this property is valid
*
* 10) invalidIn: Parent widget in which this property is not valid
* 11)propertyVisible: optional boolean for the property user-exposed in
* property view (default true)
*
* @class
*/
Expand Down Expand Up @@ -2311,6 +2313,27 @@ var BWidget = {
return schema;
},


/**
* Tests whether this property is visible to user, for example, property
* view can use it to decide if it will show this property.
*
* @param {String} widgetType The type of the widget.
* @param {String} property The name of the requested property.
* @return {Boolean} true if this property is to be shown in the property
* view, or it is undefined.
* false if the property is not to be shown in property
* view.
*/
propertyVisible: function (widgetType, property) {
var schema = BWidget.getPropertySchema(widgetType, property);
if (schema && typeof(schema.propertyVisible) == 'boolean') {
return schema.propertyVisible;
} else {
return true;
}
},

/**
* Gets the template for a given widget type.
*
Expand Down