mirror of
https://github.com/flarum/core.git
synced 2025-05-06 15:35:38 +02:00
Compile dist JS
This commit is contained in:
parent
95c9ff9243
commit
31ef02dc2c
17
js/forum/dist/app.js
vendored
17
js/forum/dist/app.js
vendored
@ -31146,20 +31146,25 @@ System.register('flarum/utils/abbreviateNumber', [], function (_export, _context
|
|||||||
System.register('flarum/utils/affixSidebar', [], function (_export, _context) {
|
System.register('flarum/utils/affixSidebar', [], function (_export, _context) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function affixSidebar(element, isInitialized) {
|
function affixSidebar(element, isInitialized, context) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if (isInitialized) return;
|
if (isInitialized) return;
|
||||||
|
|
||||||
|
var onresize = function onresize() {
|
||||||
var $sidebar = $(element);
|
var $sidebar = $(element);
|
||||||
var $header = $('#header');
|
var $header = $('#header');
|
||||||
var $footer = $('#footer');
|
var $footer = $('#footer');
|
||||||
|
var $affixElement = $sidebar.find('> ul');
|
||||||
|
|
||||||
|
$(window).off('.affix');
|
||||||
|
$affixElement.removeClass('affix affix-top affix-bottom').removeData('bs.affix');
|
||||||
|
|
||||||
// Don't affix the sidebar if it is taller than the viewport (otherwise
|
// Don't affix the sidebar if it is taller than the viewport (otherwise
|
||||||
// there would be no way to scroll through its content).
|
// there would be no way to scroll through its content).
|
||||||
if ($sidebar.outerHeight(true) > $(window).height() - $header.outerHeight(true)) return;
|
if ($sidebar.outerHeight(true) > $(window).height() - $header.outerHeight(true)) return;
|
||||||
|
|
||||||
$sidebar.find('> ul').affix({
|
$affixElement.affix({
|
||||||
offset: {
|
offset: {
|
||||||
top: function top() {
|
top: function top() {
|
||||||
return $sidebar.offset().top - $header.outerHeight(true) - parseInt($sidebar.css('margin-top'), 10);
|
return $sidebar.offset().top - $header.outerHeight(true) - parseInt($sidebar.css('margin-top'), 10);
|
||||||
@ -31169,6 +31174,14 @@ System.register('flarum/utils/affixSidebar', [], function (_export, _context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Register the affix plugin to execute on every window resize (and trigger)
|
||||||
|
$(window).on('resize', onresize).resize();
|
||||||
|
|
||||||
|
context.onunload = function () {
|
||||||
|
$(window).off('resize', onresize);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_export('default', affixSidebar);
|
_export('default', affixSidebar);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user