summaryrefslogtreecommitdiff
path: root/addons/website_quote/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-08-20 18:08:19 +0200
committerChristophe Simonis <chs@odoo.com>2016-08-20 18:08:19 +0200
commit235ed4b2c1099720a6d5cfc5ada920f19fcef315 (patch)
tree2ddc3ae85462fe3cc6e70f9598958797695d12ff /addons/website_quote/static/src/js
parentc3734ec5b622085a36e94bee36f92daabbae3e34 (diff)
parent9ad5f26b3fb98cd14527de80d19bf6554a6981e2 (diff)
[MERGE] forward port branch saas-12 up to 9ad5f26
Diffstat (limited to 'addons/website_quote/static/src/js')
-rw-r--r--addons/website_quote/static/src/js/website_quotation.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js
index 23378123f2f..a6e1b701c5e 100644
--- a/addons/website_quote/static/src/js/website_quotation.js
+++ b/addons/website_quote/static/src/js/website_quotation.js
@@ -2,6 +2,7 @@ odoo.define('website_quote.website_quote', function (require) {
'use strict';
var ajax = require('web.ajax');
+var config = require('web.config');
var Widget = require('web.Widget');
var website = require('website.website');
@@ -175,7 +176,24 @@ if(!$('.o_website_quote').length) {
nav_menu.setElement($('[data-id="quote_sidebar"]'));
nav_menu.start($('body[data-target=".navspy"]'));
- $(".o_website_quote .bs-sidebar").affix({
+ var $bs_sidebar = $(".o_website_quote .bs-sidebar");
+ $(window).on('resize', _.throttle(adapt_sidebar_position, 200, {leading: false}));
+ adapt_sidebar_position();
+
+ function adapt_sidebar_position() {
+ $bs_sidebar.css({
+ position: "",
+ width: "",
+ });
+ if (config.device.size_class >= config.device.SIZES.MD) {
+ $bs_sidebar.css({
+ position: "fixed",
+ width: $bs_sidebar.outerWidth(),
+ });
+ }
+ }
+
+ $bs_sidebar.affix({
offset: {
top: 0,
bottom: $('body').height() - $('#wrapwrap').outerHeight() + $("footer").outerHeight(),