PluginProbe
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more / 2.2
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more v2.2
3.7.0 3.6.0 3.6.1 3.5.2 trunk 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.1 3.0.0 3.0.1 All 71 releases
stockpack / assets / js / stockpack-details.js

stockpack-details.js in StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more 2.2, at assets/js/stockpack-details.js

34 lines 718 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import StockpackImage from './stockpack-image';
2
3 const StockpackDetails = StockpackImage.extend( {
4 tagName: 'div',
5 className: 'attachment-details',
6 template: wp.template( 'stockpack-attachment-details' ),
7
8 attributes() {
9 return {
10 tabIndex: 0,
11 'data-id': this.model.get( 'id' ),
12 };
13 },
14
15 initialize() {
16 this.options = _.defaults( this.options, {
17 rerenderOnModelChange: false,
18 } );
19
20 this.on( 'ready', this.initialFocus );
21 // Call 'initialize' directly on the parent class.
22 StockpackImage.prototype.initialize.apply( this, arguments );
23 },
24
25 initialFocus() {
26 if ( ! wp.media.isTouchDevice ) {
27 this.$( 'input[type="text"]' ).eq( 0 ).focus();
28 }
29 },
30
31 } );
32
33 export default StockpackDetails;
34