metafizzy / fizzy-ui-utils Goto Github PK
View Code? Open in Web Editor NEWUI utilities & helpers
UI utilities & helpers
Hi @desandro:
Your copyright notice and the MIT license text are not contained on GitHub but on a separate MIT license page (http://desandro.mit-license.org/). This actually poses a problem for automated FOSS compliance processes. While code scanners will pick up on the string 'MIT' in the README.md, your copyright notice will be systematically missed.
Would you please consider changing your license information so that your code can be more easily used in compliance with the license? A good method for declaring copyright and licensing is https://reuse.software.
Upgrading to latest version of fizzy-ui-utils breaks normal behavior when bundling with parcel's latest version (2.3.2).
When building in production mode
Uncaught TypeError: e is undefined
When building in dev mode
No error but slider behaviour is wrong (see image)
As you can see dots disapeared and all slides appart from the 1st one is invisible with flickity-fade
npm i [email protected]
npm i [email protected]
npm i [email protected]
npm i --save-dev [email protected]
Then init a flickity basic slider with the fade like this
let flkty = new Flickity(cells_container, {
lazyLoad: 3,
wrapAround: true,
fade : true,
adaptiveHeight: true,
initialIndex: -1,
prevNextButtons: false,
autoPlay: true
});
p.s: I have fixed the Uncaught TypeError: e is undefined
when building in production by changing the this
to global
in fizzy-ui-utils code.
Downgrading to [email protected]
fixes the issues but then you need 2 fizzy-ui-utils
versions
Thanks.
From 5644530#commitcomment-21357441
Hi, for some reason the change in "2.0.4" is breaking one of our tests. It turns out that on line https://github.com/metafizzy/fizzy-ui-utils/blob/master/utils.js#L202 if
dataAttrElems
isnull
,utils.makeArray( dataAttrElems )
will return an array of null:[null, null]
, thus at line https://github.com/metafizzy/fizzy-ui-utils/blob/master/utils.js#L210elem.getAttribute( dataAttr )
throw an error since it will be evaluatingnull.getAttribute
.
We have to lock the version of this module in ournpm-shrinkwrap.json
(not a direct dependency) to 2.0.3 to bypass the error.
It seems like the SSL certificate is out of date on https://registry.npm.taobao.org/fizzy-ui-utils/download/fizzy-ui-utils-2.0.7.tgz
I do not know English well
question
what work function(meton|property) modulo
Encountered this issue when using Flickity in a React context, where the Flickity lazy loader's 'load' event listener was being processed after React had removed the DOM associated with the Flickity instance. The stack trace looks like this:
Uncaught TypeError: Cannot read property 'matches' of null
at matchesSelector
at Object.utils.getParent
at Flickity.proto.getParentCell
at LazyLoader.complete
at LazyLoader.onload
at LazyLoader.utils.handleEvent
Since the DOM that is being searched is no longer in the document, it reaches an element with no parentNode
and throws this exception.
Hi @desandro ,
I can totally imagine you have better things to do, but still thought I'll let you know this one:
I've taken on the task of creating PDFs from a website I built, that makes heavy usage of Flickity and Isotope. The library of choice for the PDF creation is wkhtmltopdf. They are using the browser QTWeb to render the page and convert it to a PDF. Here is a minimal example of the terminal command with javascript debugging enabled:
$ wkhtmltopdf --debug-javascript http://my-site.com/my-page/ test.pdf
It's working fine, except of this Javascript error:
Warning: undefined:0 TypeError: 'undefined' is not a function
...not very verbose, I know it's a pain ;)
To investigate where this error is coming from, I debugged the site as described here (the MAC version seems to be broken in Mojave, I'm using the windows version with Virtual Box).
It's actually coming from a function inside of fizzy-ui-utils/utils.js
:
So the actual error is this:
TypeError: 'undefined' is not a function (evaluating 'elem.getAttribute( dataAttr )')
I would be very happy if you could take a look at this. It might be an easy fix, who knows...
I know this is an edge case, but this doesn't work in Windows Safari 5.1, there is this error in the console that stops it initialising.
It appears to be inside this function:
elems.forEach( function( elem ) {
var attr = elem.getAttribute( dataAttr ) ||
elem.getAttribute( dataOptionsAttr );
var options;
try {
options = attr && JSON.parse( attr );
} catch ( error ) {
// log error, do not initialize
if ( console ) {
console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
': ' + error );
}
return;
}
// initialize
var instance = new WidgetClass( elem, options );
// make available via $().data('namespace')
if ( jQuery ) {
jQuery.data( elem, namespace, instance );
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.