remove jquery all together
This commit is contained in:
parent
b0f5b0b059
commit
8580a1f463
61 changed files with 4113 additions and 684 deletions
|
@ -1,32 +1,30 @@
|
|||
import $ from 'jquery';
|
||||
import imagesLoaded from 'imagesloaded';
|
||||
import imagesLoaded from 'imagesloaded'
|
||||
|
||||
$(document).ready(function () {
|
||||
function resizeGridItem(item) {
|
||||
var grid = document.getElementsByClassName("note-card-holder")[0];
|
||||
var rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'));
|
||||
var rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap'));
|
||||
var rowSpan = Math.ceil((item.querySelector('.item').getBoundingClientRect().height + rowGap) / (rowHeight + rowGap));
|
||||
item.style.gridRowEnd = "span " + rowSpan;
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
function resizeGridItem (item) {
|
||||
const grid = document.getElementsByClassName('note-card-holder')[0]
|
||||
const rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'))
|
||||
const rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap'))
|
||||
const rowSpan = Math.ceil((item.querySelector('.item').getBoundingClientRect().height + rowGap) / (rowHeight + rowGap))
|
||||
item.style.gridRowEnd = 'span ' + rowSpan
|
||||
}
|
||||
|
||||
function resizeAllGridItems() {
|
||||
var allItems = document.getElementsByClassName("note-card");
|
||||
for (var x = 0; x < allItems.length; x++) {
|
||||
resizeGridItem(allItems[x]);
|
||||
}
|
||||
|
||||
function resizeAllGridItems () {
|
||||
const allItems = document.getElementsByClassName('note-card')
|
||||
for (let x = 0; x < allItems.length; x++) {
|
||||
resizeGridItem(allItems[x])
|
||||
}
|
||||
}
|
||||
|
||||
function resizeInstance(instance) {
|
||||
var item = instance.elements[0];
|
||||
resizeGridItem(item);
|
||||
|
||||
function resizeInstance (instance) {
|
||||
const item = instance.elements[0]
|
||||
resizeGridItem(item)
|
||||
}
|
||||
|
||||
// window.onload = resizeAllGridItems();
|
||||
window.addEventListener("resize", resizeAllGridItems);
|
||||
|
||||
var allItems = document.getElementsByClassName("note-card");
|
||||
for (var x = 0; x < allItems.length; x++) {
|
||||
imagesLoaded(allItems[x], resizeInstance);
|
||||
|
||||
window.addEventListener('resize', resizeAllGridItems)
|
||||
|
||||
const allItems = document.getElementsByClassName('note-card')
|
||||
for (let x = 0; x < allItems.length; x++) {
|
||||
imagesLoaded(allItems[x], resizeInstance)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue