Skip to content

Commit

Permalink
html input type component fix relax#29
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno12mota committed Sep 30, 2015
1 parent 0e01da3 commit 73e3e20
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
14 changes: 14 additions & 0 deletions assets/less/components/html-area.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.html-area {
.html-editor {
outline: 0px;
border: 0px;
border: 1px solid #cccccc;
color: #333333;
padding: 5px 20px;
.roundedCorners(2px);

&[data-medium-focused="true"] {
border-color: @adminPrimary;
}
}
}
1 change: 1 addition & 0 deletions assets/less/components/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
@import './form-state.less';
@import './pagination.less';
@import './section.less';
@import './html-area.less';


@import './page-builder/index.less';
Expand Down
2 changes: 1 addition & 1 deletion assets/less/components/input.less
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ input.invalid {
}

// White areas
.white-options {
.white-options {
.input {
input {
border-color: #cccccc;
Expand Down
34 changes: 34 additions & 0 deletions lib/components/html-area.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {Component} from 'relax-framework';
import React from 'react';
import classNames from 'classnames';

import Editor from './medium-editor';

export default class HtmlArea extends Component {
render () {
return (
<div className={classNames('html-area', this.props.className)}>
<Editor
tag='div'
className='html-editor'
value={this.props.value}
onChange={this.props.onChange}
options={{
toolbar: {
buttons: ['bold', 'italic', 'underline', 'anchor']
},
placeholder: false,
buttonLabels: 'fontawesome',
imageDragging: false
}}
/>
</div>
);
}
}

HtmlArea.propTypes = {
value: React.PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired,
className: React.PropTypes.string
};
4 changes: 3 additions & 1 deletion lib/data-types/options-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ColorPalettePicker from '../components/color-palette-picker';
import ColumnsManager from '../components/columns-manager';
import Optional from '../components/optional';
import Section from '../components/section';
import HtmlArea from '../components/html-area';

var TypesOptionsMap = {
Color: ColorPalettePicker,
Expand All @@ -33,7 +34,8 @@ var TypesOptionsMap = {
Columns: ColumnsManager,
Border: BorderPicker,
Optional,
Section
Section,
Html: HtmlArea
};

var TypesOptionsDefaultProps = {
Expand Down

0 comments on commit 73e3e20

Please sign in to comment.