Skip to content

Commit

Permalink
Add isVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmitasch committed May 11, 2023
1 parent be6af4b commit b1dcba2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/components/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default class CommentComponent extends Component {
get colorStyles() {
return {
color: this.color,
fontSize: this.args.control.size + "px"
fontSize: this.args.control.size + "px",
...((this.args.control.isVisible == false) && { display: "none"}),
}
}

Expand Down
1 change: 1 addition & 0 deletions app/components/control-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default class ControlContainerComponent extends Component {
...((control.borderColorEnabled) && { borderColor: control.borderColorRgba }),
...((control.borderColorEnabled) && { borderWidth: parseInt(control.borderWidth /2) + "px" }),
...((control.borderColorEnabled) && { borderStyle: "solid" }),
...((control.isVisible == false) && { display: "none"}),
cursor: (control.readOnly) ? "not-allowed" : ""
};

Expand Down
3 changes: 2 additions & 1 deletion app/components/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default class GroupComponent extends Component {
left: this.args.control.positionX + 'px',
top: this.args.control.positionY + 'px',
border: this.args.control.borderWidth + 'px solid ' + this.borderColor,
background: this.backgroundColor
background: this.backgroundColor,
...((this.args.control.isVisible == false) && { display: "none"})
}
} else {
return {
Expand Down
1 change: 1 addition & 0 deletions app/models/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default class ControlModel extends Model {
@attr('number') defaultUI
@attr('number') style
@attr('boolean') readOnly
@attr('boolean') isVisible

@belongsTo('dashboard') dashboard
@attr('boolean') inGroup
Expand Down
4 changes: 3 additions & 1 deletion app/serializers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ function getGroupHash(group, dashboard, index, fromGroup) {
"borderColor": group.borderColor,
"borderWidth": group.borderWidth,
"itemControlAddress": group.itemControlAddress,
"inGroup": fromGroup
"inGroup": fromGroup,
"isVisible": group.isVisible
},
"relationships": {
"controls": {
Expand Down Expand Up @@ -212,6 +213,7 @@ function getControlHash(item, dashboard, index, fromGroup) {
"defaultUI": item.defaultUI,
"style": item.style,
"readOnly": item.readOnly,
"isVisible": item.isVisible,

"inGroup": fromGroup
}
Expand Down
1 change: 1 addition & 0 deletions app/services/chataigne-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default class WebsocketService extends Service {
case "textColor":
case "borderWidth":
case "textSize":
case "isVisible":
this.store.peekAll(type).forEach(flexibleUpdateHandler(payload, itemAddress, uiParameter));
break;

Expand Down

0 comments on commit b1dcba2

Please sign in to comment.