diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index 4278328914..cf9b9392b3 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -827,6 +827,12 @@ run_test('handlebars_bug', () => { assert($(html).hasClass('pill')); }()); +(function intro_reply_hotspot() { + var html = render('intro_reply_hotspot', {}); + + assert($(html).hasClass('hotspot-message')); +}()); + (function invite_subscription() { var args = { streams: [ diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js index 0b45ca3ab8..9009a5372f 100644 --- a/static/js/click_handlers.js +++ b/static/js/click_handlers.js @@ -660,6 +660,14 @@ exports.initialize = function () { $('#hotspot_' + hotspot_name + '_icon').remove(); }); + $('body').on('click', '.hotspot-button', function (e) { + e.preventDefault(); + e.stopPropagation(); + + hotspots.post_hotspot_as_read('intro_reply'); + hotspots.close_hotspot_icon($('#hotspot_intro_reply_icon')); + }); + // stop propagation $('body').on('click', '.hotspot.overlay .hotspot-popover', function (e) { e.stopPropagation(); diff --git a/static/js/hotspots.js b/static/js/hotspots.js index 041e66c4cc..fc5788bb3d 100644 --- a/static/js/hotspots.js +++ b/static/js/hotspots.js @@ -170,6 +170,11 @@ function place_popover(hotspot) { } function insert_hotspot_into_DOM(hotspot) { + if (hotspot.name === "intro_reply") { + $('#bottom_whitespace').append(templates.render('intro_reply_hotspot', {})); + return; + } + var hotspot_overlay_HTML = templates.render('hotspot_overlay', { name: hotspot.name, title: hotspot.title, diff --git a/static/styles/hotspots.scss b/static/styles/hotspots.scss index 6b395d4380..8ad2214109 100644 --- a/static/styles/hotspots.scss +++ b/static/styles/hotspots.scss @@ -225,3 +225,27 @@ #hotspot_intro_topics_icon { z-index: 103; } + +/* hacked together intro_reply styles */ +#bottom_whitespace .hotspot-message { + text-align: center; + margin-top: 30px; + + span { + vertical-align: middle; + } + + button { + padding: 3px 9px; + min-width: 0px; + margin-left: 7px; + margin-bottom: 0px; + border: none; + font-size: .97em; + font-weight: 600; + color: white; + background-color: hsl(164, 44%, 47%); + border-radius: 4px; + white-space: normal; + } +} diff --git a/static/templates/intro_reply_hotspot.handlebars b/static/templates/intro_reply_hotspot.handlebars new file mode 100644 index 0000000000..dbdc1645cb --- /dev/null +++ b/static/templates/intro_reply_hotspot.handlebars @@ -0,0 +1,4 @@ +
+ {{t 'Click anywhere on a message to reply.' }} + +