Skip to content

Commit 0fb3bb2

Browse files
Docs: Clarify multi-select behavior in CollectionAdd and GalleryAdd controllers.
Follow-up to [30120], [31373]. Props yogeshbhutkar, mikachan, luigipulcini, SergeyBiryukov. Fixes #62696. git-svn-id: https://develop.svn.wordpress.org/trunk@61447 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 35313fa commit 0fb3bb2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/js/media/controllers/collection-add.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ var Selection = wp.media.model.Selection,
1717
* @param {object} [attributes] The attributes hash passed to the state.
1818
* @param {string} [attributes.id=library] Unique identifier.
1919
* @param {string} attributes.title Title for the state. Displays in the frame's title region.
20-
* @param {boolean} [attributes.multiple=add] Whether multi-select is enabled. @todo 'add' doesn't seem do anything special, and gets used as a boolean.
20+
* @param {boolean|string} [attributes.multiple=add] Whether multi-select is enabled. Accepts 'add' or true.
21+
* When set to true, requires Shift or Cmd/Ctrl to select multiple items.
22+
* When set to 'add', allows selecting multiple items by clicking thumbnails.
2123
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
2224
* If one is not supplied, a collection of attachments of the specified type will be created.
2325
* @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown.

src/js/media/controllers/gallery-add.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ var Selection = wp.media.model.Selection,
2020
* @param {Object} [attributes] The attributes hash passed to the state.
2121
* @param {string} [attributes.id=gallery-library] Unique identifier.
2222
* @param {string} [attributes.title=Add to Gallery] Title for the state. Displays in the frame's title region.
23-
* @param {boolean} [attributes.multiple=add] Whether multi-select is enabled. @todo 'add' doesn't seem do anything special, and gets used as a boolean.
23+
* @param {boolean|string} [attributes.multiple=add] Whether multi-select is enabled. Accepts 'add' or true.
24+
* When set to true, requires Shift or Cmd/Ctrl to select multiple items.
25+
* When set to 'add', allows selecting multiple items by clicking thumbnails.
2426
* @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse.
2527
* If one is not supplied, a collection of all images will be created.
2628
* @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown.

0 commit comments

Comments
 (0)