Browse Source

Pass footerHeight as prop

ihork 8 years ago
parent
commit
5d75ad3b77
4 changed files with 13 additions and 5 deletions
  1. 9
    1
      src/RichTextEditor.js
  2. 3
    0
      src/WebviewMessageHandler.js
  3. 1
    0
      src/const.js
  4. 0
    4
      src/editor.html

+ 9
- 1
src/RichTextEditor.js View File

21
     editorInitializedCallback: PropTypes.func,
21
     editorInitializedCallback: PropTypes.func,
22
     customCSS: PropTypes.string,
22
     customCSS: PropTypes.string,
23
     hiddenTitle: PropTypes.bool,
23
     hiddenTitle: PropTypes.bool,
24
-    enableOnChange: PropTypes.bool
24
+    enableOnChange: PropTypes.bool,
25
+    footerHeight: PropTypes.number
25
   };
26
   };
26
 
27
 
27
   constructor(props) {
28
   constructor(props) {
504
   init() {
505
   init() {
505
     this._sendAction(actions.init);
506
     this._sendAction(actions.init);
506
     this.setPlatform();
507
     this.setPlatform();
508
+    if (this.props.footerHeight) {
509
+      this.setFooterHeight();
510
+    }
507
   }
511
   }
508
 
512
 
509
   setEditorHeight(height) {
513
   setEditorHeight(height) {
510
     this._sendAction(actions.setEditorHeight, height);
514
     this._sendAction(actions.setEditorHeight, height);
511
   }
515
   }
512
 
516
 
517
+  setFooterHeight() {
518
+    this._sendAction(actions.setFooterHeight, this.props.footerHeight);
519
+  }
520
+
513
   setPlatform() {
521
   setPlatform() {
514
     this._sendAction(actions.setPlatform, Platform.OS);
522
     this._sendAction(actions.setPlatform, Platform.OS);
515
   }
523
   }

+ 3
- 0
src/WebviewMessageHandler.js View File

164
         case '${actions.setEditorHeight}':
164
         case '${actions.setEditorHeight}':
165
           zss_editor.setEditorHeight(action.data);
165
           zss_editor.setEditorHeight(action.data);
166
           break;
166
           break;
167
+        case '${actions.setFooterHeight}':
168
+          zss_editor.setFooterHeight(action.data);
169
+          break;
167
         case '${actions.setPlatform}':
170
         case '${actions.setPlatform}':
168
           zss_editor.setPlatform(action.data);
171
           zss_editor.setPlatform(action.data);
169
           break;
172
           break;

+ 1
- 0
src/const.js View File

51
   setBackgroundColor: 'SET_BACKGROUND_COLOR',
51
   setBackgroundColor: 'SET_BACKGROUND_COLOR',
52
   init: 'ZSSS_INIT',
52
   init: 'ZSSS_INIT',
53
   setEditorHeight: 'SET_EDITOR_HEIGHT',
53
   setEditorHeight: 'SET_EDITOR_HEIGHT',
54
+  setFooterHeight: 'SET_FOOTER_HEIGHT',
54
   setPlatform: 'SET_PLATFORM'
55
   setPlatform: 'SET_PLATFORM'
55
 };
56
 };
56
 
57
 

+ 0
- 4
src/editor.html View File

1710
 				padding-left: 10px;
1710
 				padding-left: 10px;
1711
 				padding-right: 10px;
1711
 				padding-right: 10px;
1712
 			}
1712
 			}
1713
-
1714
-			#zss_editor_footer {
1715
-				height: 10px;
1716
-			}
1717
 		</style>
1713
 		</style>
1718
 
1714
 
1719
 		<style type="text/css">
1715
 		<style type="text/css">