Commit Graph
19 Commits
Author SHA1 Message Date
qsm-odoo e08042ac86 [IMP] web_tour: restyle tour tips
* Remove the "?" content
* Use a background gradient
* Use a bottom transparent box-shadow instead of a surrounding opaque one
* Reduce tip size and reshape the arrow
2016-07-06 10:35:02 +02:00
qsm-odoo efed10bd9a [FIX] web_tour: tip border use
The border width was still not used correctly to compute the overlay
size, making scrollbars appear for no reason.
2016-07-05 18:05:24 +02:00
qsm-odoo 3d8d2ed50e [FIX] web_tour: ideal location to append tip
The tip was currently placed in the first parent which can scroll.
This is wrong if there is a parent which is position:fixed in that
element which scrolls (as it would not follow the scrolling as it is
fixed).
The ideal location is now the first parent which can scroll or which
is position:fixed.

Note: there are still two cases which may not work but they are
considered rare enough to not handle them :
* A position:fixed element which is overflow:hidden too
* A position:absolute element whose relative ancestor is an ancestor
of the ancestor element which can scroll.
2016-07-05 18:05:24 +02:00
Aaron Bohy fa8f818991 [IMP] web_tour: filter steps according to edition
Allows to define steps that only apply either in community or enterprise, by
setting the step's attribute 'edition' to 'community' or 'enterprise'.
If the attribute is not set, the step applies on both edition.
2016-07-05 12:42:49 +02:00
qsm-odoo 91a2881ca1 [FIX] web_tour: tours for mobile mode
Before this commit, tours were disabled for mobile mode by returning
an undefined value in the web_tour.tour JS module. This made the use
of "tour.register" or "tour.run" crash, thus making the runbot go red
if this happened while phamtomJS was running.
As it happened, some of the frontend tours goes by "preview the site
on mobile mode" which then trigger this JS crash.

This commit makes the web_tour.tour module return a fake tour object
with a register method which does nothing and a run method which
warns the user that tours cannot be launched in mobile mode.
2016-07-04 16:40:27 +02:00
Christophe Simonis 9e9369acc0 [FIX] web_tour: still keep ir.http abstract 2016-07-04 14:39:49 +02:00
Christophe Simonis 5a3a06f26f [MERGE] forward port of branch saas-11 up to d4d09df 2016-07-04 13:16:34 +02:00
Aaron Bohy 8d61316486 [FIX] web_tour: load consumed tours in the frontend
Also deactivate unnecessary magic fields for the web_tour model.
2016-06-27 10:59:39 +02:00
qsm-odoo b70c990b6a [IMP] web_tour: tip location
Choosing where to place a tip is a difficult problem.

If placed in the body element, the tip have to be repositionned on each
scroll event which is performance-consuming and induces bugs (firefox
scroll event, tips which is over an element while the anchor is under,
...).
If placed in the anchor parent which scrolls, all the above problems
are solved but when the tip opens it cannot overflow its parent
boundaries, which is not possible in many contexts (modals, ...).

The solution here is to change the tip location when it opens/closes.
When closed, it is placed in the anchor parent which scrolls. This
allows to not have to reposition the tip on each scroll. The tip is
also naturally hidden when its anchor is not visible on the screen.
When opened, the tip is placed in the body, where it can be placed
on the top of anything in the DOM.

The transition from one state to another is not noticable as the
position does not have to be computed when the tip is moved in the
DOM and the animation is purely CSS.

Note: however, this commit does not solve the firefox bug of closing
the tip when the window scrolls. Here, the temporary solution is to
let the tip be wrongly position if the user scrolls when a tip is
opened (this only occurs when using the mouse wheel anyway).
2016-06-24 17:18:44 +02:00
qsm-odoo 25a3a6f9bf [FIX] web_tour: unbind events on destroy 2016-06-24 17:18:44 +02:00
qsm-odoo 75deed4bee [FIX] web_tour: border computation of the tip
The border width was wrongly computed and was not used correctly in
the reposition algo.
2016-06-24 17:18:44 +02:00
qsm-odoo 2a2780fdf4 [FIX] web_tour: first positionning of tips
Before being positionned, the tip is at the end of the body, thus
adding a scrollbar... which prevents to calculate the correct x
position of the tip.

The chosen solution is to place the tip at the center of the screen
in LESS before the first positionning. This also prevents the content
to overflow the body and does not break animation of the tip as its
display property is always block.
2016-06-24 17:18:44 +02:00
qsm-odoo 6227abe355 [FIX] web_tour: anchor events
* Correctly bind "input" (instead of "change") or "mousedown" event
according to the anchor type. Also, only valids left clicks.
* Correctly unbind these events.
2016-06-22 11:52:42 +02:00
qsm-odoo ec6083c0c3 [FIX] web_tour: observe when dom is ready
Start observing the DOM (MutationObserver) only when it's ready.
2016-06-22 11:52:42 +02:00
qsm-odoo 65f588685a [FIX] web_tour: missing use of the force arg on scroll
* Fix scroll problem (the force argument was lost)
* Also add more meaningful names to the tip trigger methods
2016-06-17 13:20:44 +02:00
qsm-odoo cc67068360 [IMP] web_tour: tips on the border of the screen
* Adapt code to handle position/width/padding with pixel-precision
* Adapt overlay to not overflow the screen
* Do not let the content overflow the tip when closed
2016-06-17 13:20:44 +02:00
Aaron Bohy 0980546f41 [IMP] web_tour,website: enable web_tour in the frontend 2016-06-16 14:59:40 +02:00
qsm-odoo d0993c19ad [IMP] web_tour: tip animation
* Improve the JS/LESS so that its content makes the tip grow
with a bubble effect (instead of using a popover).
* Avoid flickering when the mouse leave/enter the tip or move
between the tip and its anchor element.
* Use text-align:left instead of justify
* Set the content width in JS (to a larger width) to be customizable
* Round LESS variable to avoid values like 266.6666666666
* Set opening direction according to viewport:
  - Top and bottom tips open towards the right except if they overflow
    the window on this right
  - Left and right tips open towards the bottom except if they overflow
    the window on this bottom
* Improve the 'Skip these steps' mechanism (which is easier as we don't
  use bootstrap's popover anymore)
2016-06-16 14:59:40 +02:00
Aaron Bohy 38bb6a7f81 [ADD] openerp,web,web_tour: new web_tour addon
Join work with ged
2016-06-16 14:59:40 +02:00