mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 18:29:39 +02:00
This commit is contained in:
parent
37e90e3dfe
commit
214f5d9fc3
4949 changed files with 1393320 additions and 29 deletions
34
node_modules/flickity/sandbox/js/tricky-drag.js
generated
vendored
Normal file
34
node_modules/flickity/sandbox/js/tricky-drag.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
let nonDragFlkty = new Flickity( '.carousel--non-drag', {
|
||||
draggable: false,
|
||||
} );
|
||||
|
||||
function onStaticClick( event, pointer, cellElem, cellIndex ) {
|
||||
console.log( 'staticClick', this.element.className, cellIndex );
|
||||
}
|
||||
|
||||
nonDragFlkty.on( 'staticClick', onStaticClick );
|
||||
|
||||
let singleCellFlkty = new Flickity('.carousel--single-cell');
|
||||
singleCellFlkty.on( 'staticClick', onStaticClick );
|
||||
|
||||
let groupFlkty = new Flickity( '.carousel--group', {
|
||||
groupCells: true,
|
||||
} );
|
||||
|
||||
groupFlkty.on( 'staticClick', function( event ) {
|
||||
let cellElem = event.target.closest('.carousel-cell');
|
||||
if ( cellElem ) groupFlkty.remove( cellElem );
|
||||
} );
|
||||
|
||||
function makeGroupCell() {
|
||||
let cell = document.createElement('div');
|
||||
cell.className = 'carousel-cell';
|
||||
let b = document.createElement('b');
|
||||
b.textContent = groupFlkty.cells.length + 1;
|
||||
cell.appendChild( b );
|
||||
return cell;
|
||||
}
|
||||
|
||||
document.querySelector('.add-group-cell-button').onclick = function() {
|
||||
groupFlkty.append( makeGroupCell() );
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue