Commit Graph

19 Commits

Author SHA1 Message Date
Rishi Gupta
ac48772732 hotspots.js: Fix timeout millisecond conversion. 2017-09-15 04:14:52 -07:00
Rishi Gupta
a8deedbbb6 hotspots: Replace stream_settings with intro_streams and intro_topics. 2017-09-15 04:14:52 -07:00
Rishi Gupta
0677bd2a6d hotspots: Rename and update new_topic_button. 2017-09-15 04:14:52 -07:00
Rishi Gupta
4a383544af hotspots: Rename and update click_to_reply. 2017-09-15 04:14:52 -07:00
Rishi Gupta
c985791773 hotspots.js: Inline map_hotspots_to_DOM.
The function is confusing and added unnecessary complexity, given that it is
only called in one place, and is not a function that should be exposed to
other modules.
2017-09-15 04:14:52 -07:00
Rishi Gupta
546384ce30 hotspots.js: Refactor place_icon for clarity. 2017-09-15 04:14:52 -07:00
Rishi Gupta
91819fa694 hotspots.js: Give names to long selectors in place_icon. 2017-09-15 04:14:52 -07:00
Rishi Gupta
9f7b310a3e hotspots.js: Do not place_popover if icon is not visible.
Attempting to do so throws an exception if hotspot.location.element can't be
found.
2017-09-15 04:14:52 -07:00
Rishi Gupta
836a2c502e hotspots.js: Clean up icon positioning code.
Also will allow more fine-grained positioning.
2017-09-15 04:14:52 -07:00
Rishi Gupta
09b4927578 hotspots.js: Fix hotspots not appearing.
The original had two bugs in this line of code that cancelled each other
out. 4d0f304 fixed one, causing hotspots to no longer appear. This commit
fixes the second.
2017-08-29 14:08:45 -07:00
Harshit Bansal
cd2f41dbb1 popovers: Extend the compute_placement() function.
This commit extends the `compute_placement()` function in
`popovers.js` to take into account height/width of popover as well as
positioning preference. If vertical positioning is desired and the
popover fits in either 'top/bottom' positions then we don't check for
`left/right' positions. Earlier the behavior was to prefer
'left/right'positions over 'top/bottom' positions, which resulted in
the emoji picker popping incorrectly to the left.
2017-08-27 12:27:53 -07:00
Max Schaefer
4d0f304048 js: Fix two misphrased conditions. 2017-08-22 09:37:15 -07:00
Jack Zhang
c69b5d7d65 hotkey: Add support for hotspots on enter. 2017-08-05 18:32:37 -07:00
Jack Zhang
1e40665e51 hotspots: Debounce hotspot placement on UI updates by 10ms.
A small delay to ensure that the event (i.e. a click) has completed
and the UI has updated before hotspot icon and popover placement
is recomputed.
2017-08-05 18:32:37 -07:00
Jack Zhang
5ce0db9f43 hotspots: Add friendly whale illustration to popover. 2017-08-05 18:32:37 -07:00
Jack Zhang
bbe8f73c23 popovers: Reimplement compute_placement.
compute_placement utilizes the dimensions of the viewport, viewport location of
an element, and dimensions of an element to determine if a popover will fit
horizontally and/or veritically given its orientation. The default placement
is now viewport_center, which displays the popover, without an arrow, in the
fixed center of the viewport.

This should be particularly useful for hotspots on mobile or large popovers
that contain a lot of content. The property hotspot.location.popover can be
optionally set to fix the orientation of a popover (most likely to
VIEWPORT_CENTER).
2017-08-05 18:32:37 -07:00
Jack Zhang
5a8b1e6253 hotspots: Implement hotspots frontend. 2017-07-28 16:34:15 -07:00
Rishi Gupta
dbac262509 hotspots: Change hotspots to have a name and a description. 2017-06-13 12:59:33 -07:00
Amy Liu
6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00