Browse Source

[FIX][11.0] website_anchor_smooth_scroll travis warn

pull/481/head
tbaden 6 months ago
parent
commit
7cddc63792

+ 0
- 1
website_anchor_smooth_scroll/__manifest__.py View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{

+ 16
- 16
website_anchor_smooth_scroll/static/src/js/website_anchor_smooth_scroll.js View File

@@ -2,25 +2,25 @@
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define('website_anchor_smooth_scroll.website_anchor_smooth_scroll', function (require) {

"use strict";
"use strict";

function website_anchor_smooth_scroll(event) {
event.preventDefault();
var target = $(event.currentTarget.hash);
function website_anchor_smooth_scroll (event) {
event.preventDefault();
var target = $(event.currentTarget.hash);

return $('html, body')
.stop()
.animate({
'scrollTop': target.offset().top - 100
})
.promise()
.done(function(element) {
history.pushState(null, document.title, event.target.hash);
});
}
return $('html, body')
.stop()
.animate({
'scrollTop': target.offset().top - 100,
})
.promise()
.done(function () {
history.pushState(null, document.title, event.target.hash);
});
}

require('web.dom_ready');
require('web.dom_ready');

$("a[href^='#']:not([href=#])").on("click", website_anchor_smooth_scroll);
$("a[href^='#']:not([href=#])").on("click", website_anchor_smooth_scroll);

});

Loading…
Cancel
Save