update theme
This commit is contained in:
parent
fc43dba964
commit
93fea0ed81
183 changed files with 6015 additions and 6241 deletions
|
@ -1,22 +1,40 @@
|
|||
function _getDefaultPackeryOptions() {
|
||||
return {
|
||||
percentPosition: true,
|
||||
gutter: 5,
|
||||
resize: true
|
||||
};
|
||||
return {
|
||||
percentPosition: true,
|
||||
gutter: 5,
|
||||
resize: true,
|
||||
};
|
||||
}
|
||||
|
||||
function _getPackeryOptions(nodeGallery) {
|
||||
const defaults = _getDefaultPackeryOptions();
|
||||
const {
|
||||
packeryGutter,
|
||||
packeryPercentPosition,
|
||||
packeryResize,
|
||||
} = nodeGallery.dataset;
|
||||
|
||||
return {
|
||||
percentPosition:
|
||||
packeryPercentPosition !== undefined
|
||||
? packeryPercentPosition === "true"
|
||||
: defaults.percentPosition,
|
||||
gutter:
|
||||
packeryGutter !== undefined ? parseInt(packeryGutter, 10) : defaults.gutter,
|
||||
resize:
|
||||
packeryResize !== undefined ? packeryResize === "true" : defaults.resize,
|
||||
};
|
||||
}
|
||||
|
||||
(function init() {
|
||||
$(window).on("load", function () {
|
||||
let packeries = [];
|
||||
let nodeGalleries = document.querySelectorAll(".gallery");
|
||||
|
||||
$(window).on("load", function () {
|
||||
let packeries = [];
|
||||
let nodeGalleries = document.querySelectorAll('.gallery');
|
||||
|
||||
nodeGalleries.forEach(nodeGallery => {
|
||||
// TODO : implement a reader of Packery configuration _getPackeryOptions; for example by reading data-attribute
|
||||
let packery = new Packery(nodeGallery, _getDefaultPackeryOptions());
|
||||
packeries.push(packery);
|
||||
});
|
||||
console.groupEnd();
|
||||
nodeGalleries.forEach((nodeGallery) => {
|
||||
let packery = new Packery(nodeGallery, _getPackeryOptions(nodeGallery));
|
||||
packeries.push(packery);
|
||||
});
|
||||
})();
|
||||
console.groupEnd();
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue