-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensibility #71
Comments
What about solution like below? Is it enough? const createDecoratedGallery = (albums: Array<Album>, params: Params = {}) => {
const gallery = Gallery.create(albums, params);
gallery.getElement().appendChild(
Gallery.createElement('<div style="position: absolute; top: 0; left: 0">decorated gallery</div>')
);
return gallery;
} |
I really want to be able to hook into the gallery, similar to how it happens in Trying to read all this from the dom is probably very brittle. |
I'll add this with next release. |
I commited this change. Check if is enough. |
Finally got around to implementing a gallery on top of this. It works very well, with the decorators I can keep the changes concise and understandable. The implementation is in https://github.com/csrdelft/csrdelft.nl/tree/master/resources/assets/js/fotoalbum if you're interested. |
I'm loving the ts rewrite so far!
I was wondering how to properly extend JGallery. Currently I am porting an implementation using JGallery 1 to JGallery 2, in the original implementation we used a lot of jquery trickery to modify the jgallery instance. With Typescript it seams more reasonable to extend the
JGallery
class or create decorators likewithSlideShow
.When trying to extend the
JGallery
/Gallery
class I bump into the following:in
gallery/index.ts:151
thecreate
factory method is defined, but it strictly instantiates aGallery
class.So when extending a class I cannot use the
create
method, but this way I lose theGalleryDecorator
s defined in the factory function.There is also no way to pass additional
GalleryDecorator
s when creating a JGallery instance. I'd also rather use the builtjgallery.js
instead of the typescript files.What I would like is either:
create
on a subclass ofGallery
that class is instantiated, which can be done by changing te line mentioned previously.Something like
The text was updated successfully, but these errors were encountered: