Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 10 additions & 0 deletions common/changes/users-jechayav-4_3_2017-04-03-18-22.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Callout: Allow Callout to specify beak backgroud color.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, spelling

"type": "minor"
}
],
"email": "jechayav@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export interface ICalloutProps extends React.Props<Callout | CalloutContent> {
*/
beakWidth?: number;

/**
* The background color of the beak.
* @default #ffffff
*/
beakColor?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really seems like a very weird thing to me.

Wouldn't we want to define the entire background color of the callout and make the background and beak match? Why specifically the beak, why "Color" instead of "BackgroundColor"? Why default to white?


/**
* The bounding rectangle for which the contextual menu can appear in.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
preventDismissOnScroll: false,
isBeakVisible: true,
beakWidth: 16,
beakColor: "#ffffff",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dzearing: Is there any way we can make this value themeable?

gapSpace: 16,
directionalHint: DirectionalHint.bottomAutoEdge
};
Expand Down Expand Up @@ -96,7 +97,8 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
isBeakVisible,
beakStyle,
children,
beakWidth } = this.props;
beakWidth,
beakColor } = this.props;
let { positions } = this.state;
let beakStyleWidth = beakWidth;

Expand All @@ -110,7 +112,8 @@ export class CalloutContent extends BaseComponent<ICalloutProps, ICalloutState>
top: positions && positions.beakPosition ? positions.beakPosition.top : BEAK_ORIGIN_POSITION.top,
left: positions && positions.beakPosition ? positions.beakPosition.left : BEAK_ORIGIN_POSITION.left,
height: beakStyleWidth,
width: beakStyleWidth
width: beakStyleWidth,
backgroundColor: beakColor,
};

let directionalClassName = positions && positions.directionalClassName ? `ms-u-${positions.directionalClassName}` : '';
Expand Down