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

Attachment Gallery #508

Merged
merged 13 commits into from
Nov 15, 2016
Merged

Attachment Gallery #508

merged 13 commits into from
Nov 15, 2016

Conversation

mattheu
Copy link
Contributor

@mattheu mattheu commented Oct 12, 2015

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
Copy link
Contributor Author

mattheu commented Oct 12, 2015

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
Copy link
Contributor Author

mattheu commented Oct 19, 2015

Updated - think this is ready for a review

@danielbachhuber danielbachhuber added this to the v0.7.0 milestone Oct 26, 2015
// .button.remove {
// display: block;
// }
// }
Copy link
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?

Copy link

@ameshkin ameshkin left a comment

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
Copy link
Contributor Author

mattheu commented Nov 8, 2016

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

@goldenapples
Copy link
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
Copy link
Contributor Author

mattheu commented Nov 15, 2016

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
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
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
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
Copy link
Contributor Author

mattheu commented Nov 15, 2016

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