Skip to content

Commit 5d75ad3

Browse files
committed
Pass footerHeight as prop
1 parent e899799 commit 5d75ad3

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/RichTextEditor.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export default class RichTextEditor extends Component {
2121
editorInitializedCallback: PropTypes.func,
2222
customCSS: PropTypes.string,
2323
hiddenTitle: PropTypes.bool,
24-
enableOnChange: PropTypes.bool
24+
enableOnChange: PropTypes.bool,
25+
footerHeight: PropTypes.number
2526
};
2627

2728
constructor(props) {
@@ -504,12 +505,19 @@ export default class RichTextEditor extends Component {
504505
init() {
505506
this._sendAction(actions.init);
506507
this.setPlatform();
508+
if (this.props.footerHeight) {
509+
this.setFooterHeight();
510+
}
507511
}
508512

509513
setEditorHeight(height) {
510514
this._sendAction(actions.setEditorHeight, height);
511515
}
512516

517+
setFooterHeight() {
518+
this._sendAction(actions.setFooterHeight, this.props.footerHeight);
519+
}
520+
513521
setPlatform() {
514522
this._sendAction(actions.setPlatform, Platform.OS);
515523
}

src/WebviewMessageHandler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ export const InjectedMessageHandler = `
164164
case '${actions.setEditorHeight}':
165165
zss_editor.setEditorHeight(action.data);
166166
break;
167+
case '${actions.setFooterHeight}':
168+
zss_editor.setFooterHeight(action.data);
169+
break;
167170
case '${actions.setPlatform}':
168171
zss_editor.setPlatform(action.data);
169172
break;

src/const.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const actions = {
5151
setBackgroundColor: 'SET_BACKGROUND_COLOR',
5252
init: 'ZSSS_INIT',
5353
setEditorHeight: 'SET_EDITOR_HEIGHT',
54+
setFooterHeight: 'SET_FOOTER_HEIGHT',
5455
setPlatform: 'SET_PLATFORM'
5556
};
5657

src/editor.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,10 +1710,6 @@
17101710
padding-left: 10px;
17111711
padding-right: 10px;
17121712
}
1713-
1714-
#zss_editor_footer {
1715-
height: 10px;
1716-
}
17171713
</style>
17181714

17191715
<style type="text/css">

0 commit comments

Comments
 (0)