Skip to content

Conversation

@lipemat
Copy link
Contributor

@lipemat lipemat commented Jun 1, 2018

Fixes #155.

Global support for any field that is repeatable to be sorted via drag drop.

Implement using the same sortable api following the patten of cmb.makeListSortable()
Some minor CSS changes to have a move cursor and borders around the item being dragged.

@lipemat lipemat mentioned this pull request Jun 1, 2018
@adriantoll
Copy link

Hello @lipemat - just trying this out, but my main use case is repeatable group fields. I've tried this and it doesn't seem to work for groups. Looking at the code that seems to make sense because cmb.makeRepeatableSortable() only references .cmb-field-list and .cmb-repeat-row. Great that you're working on this, so this isn't a criticism at all, but just wanted to make sure that what I've said is correct?

@lipemat
Copy link
Contributor Author

lipemat commented Jun 7, 2018

Hi @adriantoll
Because repeatable groups already have support for ordering I have not done any work on making them drag sort-able.
Sounds like that would be a nice enhancement. Probably deserves it's own pull.

@adriantoll
Copy link

adriantoll commented Jun 7, 2018 via email

@lipemat
Copy link
Contributor Author

lipemat commented Jun 9, 2018

Hey @adriantoll ,

I decided I liked your suggestion very much so I created a pull request to make groups drag sortable.
#1145

Together these features make the UI pretty slick.

@jtsternberg
Copy link
Member

Hey guys, wanted to jump in and let you know I’m excited to test these out and hopefully get them merged, but it may be a bit before I get to. Thank you so much for putting the effort in to contribute.

If you haven’t yet, please be sure to check out the contributing doc as that will make the review process smoother: https://github.com/CMB2/CMB2/blob/trunk/CONTRIBUTING.md

Thanks again!

@jtsternberg jtsternberg merged commit c04a91f into CMB2:trunk Jun 10, 2018
jtsternberg added a commit that referenced this pull request Jun 10, 2018
@jtsternberg
Copy link
Member

Tested and works well! Thank you!

lipemat added a commit to lipemat/CMB2 that referenced this pull request Jun 10, 2018
* feature/remove-default-meta-box:
  Call remove_default_tax_metaboxes from any type of post_hooks
  Add Props for CMB2#1142
  Update the draggable state's border style
  Fix docblock for CMB2_Type_Base::__call
@ljsherlock
Copy link

Hi guys and @lipemat thanks for the great work. Maybe I'm being really stupid, but I can't get this working.

Is the option: "sortable: true" all that should be required?

Thanks!

@ljsherlock
Copy link

Hi guys and @lipemat thanks for the great work. Maybe I'm being really stupid, but I can't get this working.

Is the option: "sortable: true" all that should be required?

Thanks!

Please ignore. I didn't realise that repeatable groups was a separate (open) pull: #1145 .

lipemat added a commit to lipemat/CMB2 that referenced this pull request Nov 12, 2018
* master:
  Fix PR urls in changelog
  Add props for CMB2#1179
  Qa/phpcs cleanup (CMB2#1179)
  add our minimum required php version to the readme
  Update changelong to give props for CMB2#1177
  Another instance where we should use call_user_func() instead of direct call
  use call_user_func() instead of direct call.
  Add 3 custom field types from @scottsawyer to readme resources. Closes CMB2#1171
  update some more 3rd party resource items
  cleanup phpdocs for `php_to_js_dateformat`
  update 3rd party resources to include Leaflet Map field type. Props @villeristi
  Minor correction in URL
  Added new custom field type
  Tweak inline comments, and update changelog to give props for CMB2#1166
  Add CMB2_Field::get_rest_value method for sending value through several filters before sending to REST request
  WP_Http class constants were added in WP 4.5
  Doing it CMB2 way
  Fix the issue in WP prior to 4.7
  Add Switch Button field type to resources. Closes CMB2#1151
  make remove_default_tax_metaboxes method public so it may be called by hooks
  Call remove_default_tax_metaboxes from any type of post_hooks
  Call remove_default_tax_metaboxes from any type of post_hooks
  Add Props for CMB2#1142
  Update the draggable state's border style
  support drag sorting for groups
  Fix docblock for CMB2_Type_Base::__call
lipemat added a commit to lipemat/CMB2 that referenced this pull request Jul 19, 2019
…ng-for-groups

* upstream/trunk:
  Add props for CMB2#1147
  Some additional cleanup on CMB2#1147
  Add props for CMB2#1187
  Pull in the nodename, and default to div
  Make field description color accessible (fix color contrast ratio). h/t @rianrietveld. Fixes CMB2#1193
  Add optional mb_callback_args box property which allows defining args for add_meta_box. Closes CMB2#1191
  Update changelong to give @staurand props for CMB2#1190 (Fixes CMB2#1156)
  Revert file changes from CMB2#1190 and move gutenberg compatibility callback to main cmb JS file
  Update assets
  Fix tests: add cmb2-wysiwyg-gutenberg-fix as js dependency
  Fix CMB2#1156 / Update Gruntfile
  Fix CMB2#1156
  Updates 1187 - explicitly specifiy closing bracket when adding a new row to group
  support any type of markup when repeating group row
  Fix PR urls in changelog
  Add props for CMB2#1179
  Qa/phpcs cleanup (CMB2#1179)
  add our minimum required php version to the readme
  Update changelong to give props for CMB2#1177
  Another instance where we should use call_user_func() instead of direct call
  use call_user_func() instead of direct call.
  Add 3 custom field types from @scottsawyer to readme resources. Closes CMB2#1171
  update some more 3rd party resource items
  cleanup phpdocs for `php_to_js_dateformat`
  update 3rd party resources to include Leaflet Map field type. Props @villeristi
  Minor correction in URL
  Added new custom field type
  Tweak inline comments, and update changelog to give props for CMB2#1166
  Add CMB2_Field::get_rest_value method for sending value through several filters before sending to REST request
  WP_Http class constants were added in WP 4.5
  Doing it CMB2 way
  Fix the issue in WP prior to 4.7
  Add Switch Button field type to resources. Closes CMB2#1151
  make remove_default_tax_metaboxes method public so it may be called by hooks
  Call remove_default_tax_metaboxes from any type of post_hooks
  Add Props for CMB2#1142
  Update the draggable state's border style
  Fix docblock for CMB2_Type_Base::__call
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