update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / composer / src / src / components / Button.js
index 76a569f..65b90fd 100644 (file)
@@ -40,6 +40,7 @@ const Button = React.createClass({
                        label: null,
                        title: null,
                        src: null,
+                       disabled: false,
                        onClick: () => {}
                };
        },
@@ -57,8 +58,15 @@ const Button = React.createClass({
                const title = this.props.title;
                const draggable = this.props.draggable;
                const className = ClassNames(this.props.className, 'Button');
+               let style = {
+               }
+               if(this.props.disabled) {
+                       style.pointerEvents = 'none';
+                       style.cursor = 'not-allowed';
+                       style.opacity = 0.25;
+               }
                return (
-                       <div className={className} onClick={this.props.onClick} title={title} draggable={draggable} onDragStart={this.props.onDragStart}>
+                       <div className={className} onClick={this.props.onClick} title={title} draggable={draggable} onDragStart={this.props.onDragStart} style={style}>
                                { src ? <img src={src} /> : null }
                                {label}
                        </div>