Skip to content

Attachment Gallery#508

Merged
goldenapples merged 13 commits into
masterfrom
attachment-gallery
Nov 15, 2016
Merged

Attachment Gallery#508
goldenapples merged 13 commits into
masterfrom
attachment-gallery

Conversation

@mattheu

@mattheu mattheu commented Oct 12, 2015

Copy link
Copy Markdown
Contributor

Support multiple: true on the attachments field.

2 issues i've run into.

  1. the code to select the attachments if you edit the selection works the first time, but not the second. I cannot work out why not ;)
  2. How to display the attachment data stuff.
    • Also could we make the display of this optional?

@mattheu

mattheu commented Oct 12, 2015

Copy link
Copy Markdown
Contributor Author

Oh gotta sync this up.

…nt-gallery

# Conflicts:
#	css/shortcode-ui.css
#	css/shortcode-ui.css.map
#	dev.php
#	inc/fields/class-field-attachment.php
#	js-tests/build/specs.js
#	js/build/shortcode-ui.js
@mattheu

mattheu commented Oct 19, 2015

Copy link
Copy Markdown
Contributor Author

Updated - think this is ready for a review

@danielbachhuber danielbachhuber added this to the v0.7.0 milestone Oct 26, 2015
Comment thread css/sass/_field-image.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be commented out?

@ameshkin ameshkin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just what i was looking for

…hment-gallery

# Conflicts:
#	css/shortcode-ui-editor-styles.css.map
#	css/shortcode-ui.css
#	css/shortcode-ui.css.map
#	dev.php
#	js/build/shortcode-ui.js
#	js/src/views/edit-attribute-field-attachment.js
@mattheu

mattheu commented Nov 8, 2016

Copy link
Copy Markdown
Contributor Author

Updated. @goldenapples this should be ready to go.,

@goldenapples

Copy link
Copy Markdown
Contributor

Seems workable as an initial step here.

I'm seeing some weird styling on the .attachment element in the shortcode modal:

screen shot 2016-11-08 at 8 11 54 am

screen shot 2016-11-08 at 8 13 39 am

... which is coming from this core style, forcing that to 16.66% of its container, when we actually want it to fill the whole container:

screen shot 2016-11-08 at 8 16 01 am

Also, I'm not sure if the first issue is actually worked out, is it? When I edit a shortcode after sending it to the editor once, I don't see the previously selected items as selected. It would probably be good to figure that behavior out before merging this, as otherwise that will cause some editorial headaches.

…hment-gallery

# Conflicts:
#	js/build/shortcode-ui.js
#	js/src/views/edit-attribute-field-attachment.js
@mattheu

mattheu commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

I've pushed some updates for the styles.

I'm no longer seeing any issues with the gallery images not loading, although they it does have to fetch the attachment data, so there is a little delay on this, but they should pop in.

this.$thumbnailDetailsContainer.toggleClass( 'has-attachment', true );
value.sort( function( a, b ) {
return a < b;
} );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sure about sorting the selected attachments by attachment ID, but as we don't have a sortable implementation here yet, this will do as a first introduction to the feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a think about how to tackle this one.

@goldenapples

Copy link
Copy Markdown
Contributor

Very nice 💯

This looks and works a lot better for me. I wasn't able to reproduce the issue I was seeing before where selected images are unselected when opening the media frame to select new images. I'm not sure if it was a bug that you fixed, or if I was just confused about the UI before. (Having to command-select to add a selection seems strange, especially if you're on a page of images that don't show any attachments selected already.)

The code looks good to me. I'm pretty sure that at some point we'll have to support user-defined ordering of attachments in a gallery, but this is a good chunk of code to merge at one time. I can open a new issue for sortable images, and merge this as is.

@goldenapples goldenapples merged commit 8d2f567 into master Nov 15, 2016
@goldenapples goldenapples deleted the attachment-gallery branch November 15, 2016 16:53
@mattheu

mattheu commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

Yes command select images isn't totally obvious, but at least lets us achive the goal.

I'll have a look at how to improve this further. Perhaps we can bring in more of the core UI for galleries.

jeremyfelt added a commit to washingtonstateuniversity/image-shortcake that referenced this pull request May 22, 2017
The `getFromCache()` method was deprecated in Shortcode UI via
wp-shortcake/shortcake#508

This should work as a band-aid until fixed upstream via
wp-shortcake#75
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

Successfully merging this pull request may close these issues.

4 participants