Changeset 42353
- Timestamp:
- 12/03/2017 06:55:31 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-views.js
r41937 r42353 2298 2298 * wp.media.controller.Cropper 2299 2299 * 2300 * A state for cropping an image.2300 * A class for cropping an image when called from the header media customization panel. 2301 2301 * 2302 2302 * @memberOf wp.media.controller … … 2320 2320 }, 2321 2321 2322 /** 2323 * @summary Opens the crop image window. 2324 * 2325 * Shows the crop image window when called from the Add new image button. 2326 * 2327 * @since 4.2.0 2328 * 2329 * @returns {void} 2330 */ 2322 2331 activate: function() { 2323 2332 this.frame.on( 'content:create:crop', this.createCropContent, this ); … … 2326 2335 }, 2327 2336 2337 /** 2338 * @summary Changes the state of the toolbar window to browse mode. 2339 * 2340 * @since 4.2.0 2341 * 2342 * @returns {void} 2343 */ 2328 2344 deactivate: function() { 2329 2345 this.frame.toolbar.mode('browse'); 2330 2346 }, 2331 2347 2348 /** 2349 * @summary Creates the crop image window. 2350 * 2351 * Initialized when clicking on the Select and Crop button. 2352 * 2353 * @since 4.2.0 2354 * 2355 * @fires crop window 2356 * 2357 * @returns {void} 2358 */ 2332 2359 createCropContent: function() { 2333 2360 this.cropperView = new wp.media.view.Cropper({ … … 2339 2366 2340 2367 }, 2368 2369 /** 2370 * @summary Removes the image selection and closes the cropping window. 2371 * 2372 * @since 4.2.0 2373 * 2374 * @returns {void} 2375 */ 2341 2376 removeCropper: function() { 2342 2377 this.imgSelect.cancelSelection(); … … 2345 2380 this.cropperView.remove(); 2346 2381 }, 2382 2383 /** 2384 * @summary Checks if cropping can be skipped and creates crop toolbar accordingly. 2385 * 2386 * @since 4.2.0 2387 * 2388 * @returns {void} 2389 */ 2347 2390 createCropToolbar: function() { 2348 2391 var canSkipCrop, toolbarOptions; … … 2400 2443 }, 2401 2444 2445 /** 2446 * @summary Creates an object with the image attachment and crop properties. 2447 * 2448 * @since 4.2.0 2449 * 2450 * @returns {$.promise} A jQuery promise with the custom header crop details. 2451 */ 2402 2452 doCrop: function( attachment ) { 2403 2453 return wp.ajax.post( 'custom-header-crop', _.extend(
Note: See TracChangeset
for help on using the changeset viewer.