Skip to content

Commit

Permalink
Merge branch 'master' into install_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
downiec committed Nov 1, 2018
2 parents fc9d04f + a073da3 commit 18e93e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class AddEditRemoveNav extends PureComponent {
</a>
</li>
<li className="action-edit-button">
<a href="#" onClick={this.props.editAction} title={this.props.editText ? this.props.editText : ""}>
<i className={`glyphicon glyphicon-edit ${this.props.editAction ? "" : "disabled"}`}></i>
<a href="#" id={`${this.props.title.replace(" ", "-")}-anchor`} onClick={this.props.editAction} title={this.props.editText ? this.props.editText : ""}>
<i id={`${this.props.title.replace(" ", "-")}`} className={`glyphicon glyphicon-edit ${this.props.editAction ? "" : "disabled"}`}></i>
</a>
</li>
<li className="action-remove-button">
Expand All @@ -33,6 +33,9 @@ class AddEditRemoveNav extends PureComponent {
}
}

AddEditRemoveNav.defaultProps = {
title: 'default title'
}
AddEditRemoveNav.propTypes = {
addAction: PropTypes.func,
editAction: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$add-base: rgba(40, 167, 69, .8);
$edit-base: rgba(217, 120, 36, .8);
$edit-base: rgba(217, 120, 36, .8);
$remove-base:rgba(196, 28, 31, .8);

$add-hover:rgba(66, 193, 95, .8);
Expand Down Expand Up @@ -32,6 +32,9 @@ li.action-edit-button:hover i.glyphicon.glyphicon-edit{
li.action-edit-button:hover i.glyphicon.glyphicon-edit.disabled{
color: $disabled-hover;
}
#Graphics-Methods-anchor.disabled{
pointer-events: none;
}

i.glyphicon.glyphicon-remove-sign{
color: $remove-base;
Expand All @@ -48,4 +51,4 @@ li.action-remove-button:hover i.glyphicon.glyphicon-remove-sign.disabled{
i.glyphicon.disabled{
color: $disabled-base;
cursor: not-allowed;
}
}
16 changes: 13 additions & 3 deletions frontend/src/js/components/GMList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class GMList extends Component {
toast.info("A Graphics Method must be selected to edit", { position: toast.POSITION.BOTTOM_CENTER })
return
}

const gm = this.props.graphics_methods[this.props.selected_graphics_type][this.props.selected_graphics_method]
if(SUPPORTED_GM_EDITORS && !SUPPORTED_GM_EDITORS.includes(gm.g_name)) {
toast.warn("This graphics method does not have an editor yet.", { position: toast.POSITION.BOTTOM_CENTER })
Expand Down Expand Up @@ -118,6 +117,17 @@ class GMList extends Component {
let gm = path[1]
let gm_parent = path[0]
this.props.selectGraphicsMethod(gm_parent, gm)
const g_name = this.props.graphics_methods[gm_parent][gm]["g_name"]
let edit_button = document.getElementById("Graphics-Methods");
let edit_anchor = document.getElementById("Graphics-Methods-anchor");
if (!SUPPORTED_GM_EDITORS.includes(g_name)){
edit_button.className = "glyphicon glyphicon-edit.disabled"
edit_anchor.className = "disabled"
}
else {
edit_button.className = "glyphicon glyphicon-edit"
edit_anchor.className = ""
}
}
}

Expand All @@ -138,7 +148,7 @@ class GMList extends Component {

return (
<div className='left-side-list scroll-area-list-parent gm-list-container'>
<AddEditRemoveNav
<AddEditRemoveNav
title='Graphics Methods'
addAction={this.clickedAdd}
addText="Create a new Graphics Method"
Expand All @@ -157,7 +167,7 @@ class GMList extends Component {
show={this.state.show_edit_modal}
onHide={this.closeEditModal}
/>
:
:
""
}
<div className='scroll-area'>
Expand Down

0 comments on commit 18e93e8

Please sign in to comment.