Skip to content
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

Making the first image be the potential orphan #37

Open
domarty opened this issue Jun 13, 2014 · 1 comment
Open

Making the first image be the potential orphan #37

domarty opened this issue Jun 13, 2014 · 1 comment

Comments

@domarty
Copy link

domarty commented Jun 13, 2014

Right now, the script sometimes places the final image on its own row. Setting allowPartialLastRow to false then makes the last image huge -- which looks great, but the first image is frequently the most important image, and the one that would look best at full width.

When the image collection requires there be an orphaned image, I'd love the option to make the first image be the orphan instead.

(My guess is this would mean reversing the list of images before assembling rows, and then again reversing both the images in each row and the rows themselves before returning the final markup.)

@domarty
Copy link
Author

domarty commented Jun 13, 2014

Actually, it turns out to be easier than I thought. Locally, I added an allowPartialFirstRow option, and only had to make two other changes:

Just before settings.images.each:

if (settings.allowPartialFirstRow) { settings.images = $($this.children().get().reverse()); }

And in applyModifications:

if (settings.allowPartialFirstRow) {
     css['margin-left'] = css['margin-right']; //crude but effective
     delete css['margin-right'];
}

Works beautifully. Anyway, I'd still love to see the functionality in collagePlus proper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant