Changeset 42931
- Timestamp:
- 04/03/2018 07:48:11 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/js/media-views.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-views.js
r42740 r42931 1244 1244 * A state for editing a gallery's images and settings. 1245 1245 * 1246 * @ memberOf wp.media.controller1246 * @since 3.5.0 1247 1247 * 1248 1248 * @class … … 1250 1250 * @augments wp.media.controller.State 1251 1251 * @augments Backbone.Model 1252 * 1253 * @memberOf wp.media.controller 1252 1254 * 1253 1255 * @param {object} [attributes] The attributes hash passed to the state. … … 1265 1267 * @param {boolean} [attributes.displaySettings=true] Whether to show the attachment display settings interface. 1266 1268 * @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable. 1267 * @param { int}[attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.1269 * @param {number} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments. 1268 1270 * @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance. 1269 * @param { int}[attributes.priority=60] The priority for the state link in the media menu.1271 * @param {number} [attributes.priority=60] The priority for the state link in the media menu. 1270 1272 * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. 1271 1273 * Defaults to false for this state, because the library passed in *is* the selection. … … 1393 1395 * A state for selecting more images to add to a gallery. 1394 1396 * 1395 * @ memberOf wp.media.controller1397 * @since 3.5.0 1396 1398 * 1397 1399 * @class … … 1400 1402 * @augments Backbone.Model 1401 1403 * 1402 * @param {object} [attributes] The attributes hash passed to the state. 1404 * @memberof wp.media.controller 1405 * 1406 * @param {Object} [attributes] The attributes hash passed to the state. 1403 1407 * @param {string} [attributes.id=gallery-library] Unique identifier. 1404 1408 * @param {string} [attributes.title=Add to Gallery] Title for the state. Displays in the frame's title region. … … 1417 1421 * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. 1418 1422 * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. 1419 * @param { int}[attributes.priority=100] The priority for the state link in the media menu.1423 * @param {number} [attributes.priority=100] The priority for the state link in the media menu. 1420 1424 * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. 1421 1425 * Defaults to false because for this state, because the library of the Edit Gallery state is the selection. … … 1434 1438 1435 1439 /** 1440 * Initializes the library. Creates a library of images if a library isn't supplied. 1441 * 1436 1442 * @since 3.5.0 1443 * 1444 * @returns {void} 1437 1445 */ 1438 1446 initialize: function() { 1439 // If a library wasn't supplied, create a library of images.1440 1447 if ( ! this.get('library') ) { 1441 1448 this.set( 'library', wp.media.query({ type: 'image' }) ); … … 1446 1453 1447 1454 /** 1455 * Activates the library. 1456 * 1457 * Removes all event listeners if in edit mode. Creates a validator to check an attachment. 1458 * Resets library and re-enables event listeners. Activates edit mode. Calls the parent's activate method. 1459 * 1448 1460 * @since 3.5.0 1461 * 1462 * @returns {void} 1449 1463 */ 1450 1464 activate: function() { … … 1456 1470 } 1457 1471 1458 // Accepts attachments that exist in the original library and 1459 // that do not exist in gallery's library. 1472 /* 1473 * Accept attachments that exist in the original library but 1474 * that do not exist in gallery's library yet. 1475 */ 1460 1476 library.validator = function( attachment ) { 1461 1477 return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments ); 1462 1478 }; 1463 1479 1464 // Reset the library to ensure that all attachments are re-added 1465 // to the collection. Do so silently, as calling `observe` will 1466 // trigger the `reset` event. 1480 /* 1481 * Reset the library to ensure that all attachments are re-added 1482 * to the collection. Do so silently, as calling `observe` will 1483 * trigger the `reset` event. 1484 */ 1467 1485 library.reset( library.mirroring.models, { silent: true }); 1468 1486 library.observe( edit );
Note: See TracChangeset
for help on using the changeset viewer.