Commit b6e7d2c1 authored by Matt Vanderpol's avatar Matt Vanderpol

Support to add a “custom tool” input

parent 6d6bb37d
...@@ -58,9 +58,14 @@ var CategoryRoiChooser = { ...@@ -58,9 +58,14 @@ var CategoryRoiChooser = {
}, },
setup: function() { setup: function() {
$(document).on('click', '.js-roi-choose-tool', this.handleToolClick.bind(this)); $(document).on('click', '.js-roi-choose-tool', this.handleToolClick.bind(this));
$(document).on('click', '.js-add-tool', this.handleAddToolClick.bind(this));
}, },
handleToolClick: function(event) { handleToolClick: function(event) {
$(event.currentTarget).toggleClass('is-selected'); $(event.currentTarget).toggleClass('is-selected');
},
handleAddToolClick: function(event) {
var $$ = $(event.currentTarget);
$$.before('<input type="text" class="custom-tool-input" data-stage="' + $$.data('stage') + '">');
} }
}; };
$(CategoryRoiChooser.init.bind(CategoryRoiChooser)); $(CategoryRoiChooser.init.bind(CategoryRoiChooser));
...@@ -37,7 +37,7 @@ extra_js: ...@@ -37,7 +37,7 @@ extra_js:
= competitor.name = competitor.name
.tooltip-carat .tooltip-carat
%img.competitor-logo{ src: "#{competitor.logo}", alt: "#{competitor.name} logo png" } %img.competitor-logo{ src: "#{competitor.logo}", alt: "#{competitor.name} logo png" }
%span.add-tool.js-add-tool %span.add-tool.js-add-tool{ data: { stage: stage.key } }
= partial "images/icons/add.svg" = partial "images/icons/add.svg"
......
...@@ -169,4 +169,9 @@ $lt-border-style: 1px solid $color-gray-extra-light; ...@@ -169,4 +169,9 @@ $lt-border-style: 1px solid $color-gray-extra-light;
.add-tool { .add-tool {
cursor: pointer; cursor: pointer;
} }
.custom-tool-input {
max-width: 100%;
margin-bottom: 16px;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment