Skip to content

Commit b4f7566

Browse files
authored
Merge pull request #280 from hugoabernier/dev
Fixed #279
2 parents f18ba3c + c212ef9 commit b4f7566

File tree

3 files changed

+39
-23
lines changed

3 files changed

+39
-23
lines changed

package-lock.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/controls/richText/RichText.module.scss

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
}
6464

6565
.toolbarDropDownOption {
66+
6667
&.toolbarButtonH2 {
6768
font-size: 21px;
6869
font-weight: 100;
@@ -378,23 +379,25 @@
378379
line-height: 1.3;
379380
}
380381

381-
.ms-Dropdown-item {
382-
background-color: $ms-color-neutralPrimary !important;
383-
color: $ms-color-neutralLighterAlt !important;
384-
-webkit-transition: all 0.3s;
385-
transition: all 0.3s;
386-
-webkit-transition-property: background-color, color;
387-
}
382+
div#DropDownStyles-list, div#DropDownAlign-list, div#DropDownLists-list {
383+
.ms-Dropdown-item {
384+
background-color: $ms-color-neutralPrimary !important;
385+
color: $ms-color-neutralLighterAlt !important;
386+
-webkit-transition: all 0.3s;
387+
transition: all 0.3s;
388+
-webkit-transition-property: background-color, color;
389+
}
388390

389-
.ms-Dropdown-item:hover {
390-
background-color: $ms-color-neutralSecondaryAlt !important;
391-
color: $ms-color-neutralLighterAlt !important;
392-
cursor: pointer;
393-
}
391+
.ms-Dropdown-item:hover {
392+
background-color: $ms-color-neutralSecondaryAlt !important;
393+
color: $ms-color-neutralLighterAlt !important;
394+
cursor: pointer;
395+
}
394396

395-
.ms-Dropdown-item.is-selected,
396-
.ms-Dropdown-item.is-selected:hover {
397-
background-color: $ms-color-themePrimary !important;
398-
color: $ms-color-neutralLighterAlt !important;
397+
.ms-Dropdown-item.is-selected,
398+
.ms-Dropdown-item.is-selected:hover {
399+
background-color: $ms-color-themePrimary !important;
400+
color: $ms-color-neutralLighterAlt !important;
401+
}
399402
}
400403
}

src/controls/richText/RichText.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Dropdown, IDropdownOption } from 'office-ui-fabric-react/lib/Dropdown';
1616
import { Icon } from 'office-ui-fabric-react/lib/Icon';
1717
import { elementContains } from 'office-ui-fabric-react/lib/Utilities';
1818
import * as telemetry from '../../common/telemetry';
19+
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
1920

2021

2122
const TOOLBARPADDING: number = 28;
@@ -27,6 +28,9 @@ const TOOLBARPADDING: number = 28;
2728
* - Block quotes only work on single lines. This is a frequently-requested feature with Quill that isn't available yet.
2829
* - Tables aren't supported yet. I'll gladly add table formatting support if users request it.
2930
*/
31+
32+
initializeIcons();
33+
3034
export class RichText extends React.Component<IRichTextProps, IRichTextState> {
3135
private _quillElem: ReactQuill = undefined;
3236
private _wrapperRef: HTMLDivElement = undefined;
@@ -36,7 +40,7 @@ export class RichText extends React.Component<IRichTextProps, IRichTextState> {
3640
private ddStyleOpts = [{
3741
key: 0,
3842
text: strings.HeaderNormalText,
39-
data: {}
43+
data: { }
4044
}, {
4145
key: 2,
4246
text: strings.HeaderH2,
@@ -439,11 +443,13 @@ export class RichText extends React.Component<IRichTextProps, IRichTextState> {
439443
Quill.register(SizeClass, true);
440444

441445
return (
442-
<div ref={(ref) => this._wrapperRef = ref} className={`${styles.richtext && this.state.editing ? 'ql-active' : undefined} ${this.props.className}`}>
446+
<div ref={(ref) => this._wrapperRef = ref} className={`${styles.richtext && this.state.editing ? 'ql-active' : ''} ${this.props.className}`}>
443447
<div id={this._toolbarId} style={{top:this.state.wrapperTop}}>
444448
{
445449
showStyles && (
446-
<Dropdown className={`${styles.headerDropDown} ${styles.toolbarDropDown}`}
450+
<Dropdown
451+
id="DropDownStyles"
452+
className={`${styles.headerDropDown} ${styles.toolbarDropDown}`}
447453
onRenderCaretDown={() => <Icon className={styles.toolbarSubmenuCaret} iconName="CaretDownSolid8" />}
448454
selectedKey={this.state.formats.header || 0}
449455
options={this.ddStyleOpts}
@@ -492,6 +498,7 @@ export class RichText extends React.Component<IRichTextProps, IRichTextState> {
492498
{
493499
showAlign && (
494500
<Dropdown className={`${styles.toolbarDropDown}`}
501+
id="DropDownAlign"
495502
onRenderCaretDown={() => <Icon className={styles.toolbarSubmenuCaret} iconName="CaretDownSolid8" />}
496503
selectedKey={this.state.formats.align || 'left'}
497504
options={this.ddAlignOpts}
@@ -504,6 +511,7 @@ export class RichText extends React.Component<IRichTextProps, IRichTextState> {
504511
{
505512
showList && (
506513
<Dropdown className={styles.toolbarDropDown}
514+
id="DropDownLists"
507515
onRenderCaretDown={() => <Icon className={styles.toolbarSubmenuCaret} iconName="CaretDownSolid8" />}
508516
selectedKey={this.state.formats.list}
509517
options={this.ddListOpts}

0 commit comments

Comments
 (0)