diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index b30e703..b89b329 100644
|
|
|
297 | 297 | /** |
298 | 298 | * wp.media.controller.State |
299 | 299 | * |
| 300 | * A state is a step in a workflow that when set will trigger |
| 301 | * the controllers for the regions to be updated as specified. This |
| 302 | * class is the base class that the various states used in the media |
| 303 | * modals extend. |
| 304 | * |
300 | 305 | * @constructor |
301 | 306 | * @augments Backbone.Model |
302 | 307 | */ |
… |
… |
|
792 | 797 | if ( ! this.get('AttachmentView') ) { |
793 | 798 | this.set( 'AttachmentView', media.view.Attachment.EditLibrary ); |
794 | 799 | } |
795 | | /** |
796 | | * call 'initialize' directly on the parent class |
797 | | */ |
| 800 | |
798 | 801 | media.controller.Library.prototype.initialize.apply( this, arguments ); |
799 | 802 | }, |
800 | 803 | |
… |
… |
|
808 | 811 | this.get('library').observe( wp.Uploader.queue ); |
809 | 812 | |
810 | 813 | this.frame.on( 'content:render:browse', this.gallerySettings, this ); |
811 | | /** |
812 | | * call 'activate' directly on the parent class |
813 | | */ |
| 814 | |
814 | 815 | media.controller.Library.prototype.activate.apply( this, arguments ); |
815 | 816 | }, |
816 | 817 | |
… |
… |
|
819 | 820 | this.get('library').unobserve( wp.Uploader.queue ); |
820 | 821 | |
821 | 822 | this.frame.off( 'content:render:browse', this.gallerySettings, this ); |
822 | | /** |
823 | | * call 'deactivate' directly on the parent class |
824 | | */ |
| 823 | |
825 | 824 | media.controller.Library.prototype.deactivate.apply( this, arguments ); |
826 | 825 | }, |
827 | 826 | |
… |
… |
|
886 | 885 | if ( ! this.get('library') ) { |
887 | 886 | this.set( 'library', media.query({ type: 'image' }) ); |
888 | 887 | } |
889 | | /** |
890 | | * call 'initialize' directly on the parent class |
891 | | */ |
892 | 888 | media.controller.Library.prototype.initialize.apply( this, arguments ); |
893 | 889 | }, |
894 | 890 | |
… |
… |
|
903 | 899 | // Accepts attachments that exist in the original library and |
904 | 900 | // that do not exist in gallery's library. |
905 | 901 | library.validator = function( attachment ) { |
906 | | return !! this.mirroring.get( attachment.cid ) |
907 | | && ! edit.get( attachment.cid ) |
908 | | /** |
909 | | * call 'validator' directly on wp.media.model.Selection |
910 | | */ |
911 | | && media.model.Selection.prototype.validator.apply( this, arguments ); |
| 902 | return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && |
| 903 | media.model.Selection.prototype.validator.apply( this, arguments ); |
912 | 904 | }; |
913 | 905 | |
914 | 906 | // Reset the library to ensure that all attachments are re-added |
… |
… |
|
917 | 909 | library.reset( library.mirroring.models, { silent: true }); |
918 | 910 | library.observe( edit ); |
919 | 911 | this.editLibrary = edit; |
920 | | /** |
921 | | * call 'activate' directly on the parent class |
922 | | */ |
| 912 | |
923 | 913 | media.controller.Library.prototype.activate.apply( this, arguments ); |
924 | 914 | } |
925 | 915 | }); |
… |
… |
|
950 | 940 | if ( ! this.get('library') ) { |
951 | 941 | this.set( 'library', media.query({ type: 'image' }) ); |
952 | 942 | } |
953 | | /** |
954 | | * call 'initialize' directly on the parent class |
955 | | */ |
| 943 | |
956 | 944 | media.controller.Library.prototype.initialize.apply( this, arguments ); |
957 | 945 | |
958 | 946 | library = this.get('library'); |
… |
… |
|
981 | 969 | activate: function() { |
982 | 970 | this.updateSelection(); |
983 | 971 | this.frame.on( 'open', this.updateSelection, this ); |
984 | | /** |
985 | | * call 'activate' directly on the parent class |
986 | | */ |
| 972 | |
987 | 973 | media.controller.Library.prototype.activate.apply( this, arguments ); |
988 | 974 | }, |
989 | 975 | |
990 | 976 | deactivate: function() { |
991 | 977 | this.frame.off( 'open', this.updateSelection, this ); |
992 | | /** |
993 | | * call 'deactivate' directly on the parent class |
994 | | */ |
| 978 | |
995 | 979 | media.controller.Library.prototype.deactivate.apply( this, arguments ); |
996 | 980 | }, |
997 | 981 | |
… |
… |
|
1038 | 1022 | if ( ! this.get('library') ) { |
1039 | 1023 | this.set( 'library', media.query({ type: 'image' }) ); |
1040 | 1024 | } |
1041 | | /** |
1042 | | * call 'initialize' directly on the parent class |
1043 | | */ |
| 1025 | |
1044 | 1026 | media.controller.Library.prototype.initialize.apply( this, arguments ); |
1045 | 1027 | |
1046 | 1028 | library = this.get('library'); |
… |
… |
|
1068 | 1050 | |
1069 | 1051 | activate: function() { |
1070 | 1052 | this.updateSelection(); |
1071 | | /** |
1072 | | * call 'activate' directly on the parent class |
1073 | | */ |
1074 | 1053 | media.controller.Library.prototype.activate.apply( this, arguments ); |
1075 | 1054 | }, |
1076 | 1055 | |
1077 | | deactivate: function() { |
1078 | | /** |
1079 | | * call 'deactivate' directly on the parent class |
1080 | | */ |
1081 | | media.controller.Library.prototype.deactivate.apply( this, arguments ); |
1082 | | }, |
1083 | | |
1084 | 1056 | updateSelection: function() { |
1085 | 1057 | var selection = this.get('selection'), |
1086 | 1058 | attachment = this.image.attachment; |
… |
… |
|
1268 | 1240 | /** |
1269 | 1241 | * wp.media.view.Frame |
1270 | 1242 | * |
| 1243 | * A frame is a composite view consisting of one or more regions and one or more |
| 1244 | * states. Only one state can be active at any given moment. |
| 1245 | * |
1271 | 1246 | * @constructor |
1272 | 1247 | * @augments wp.media.View |
1273 | 1248 | * @augments wp.Backbone.View |
… |
… |
|
1327 | 1302 | /** |
1328 | 1303 | * wp.media.view.MediaFrame |
1329 | 1304 | * |
| 1305 | * Type of frame used to create the media modal. |
| 1306 | * |
1330 | 1307 | * @constructor |
1331 | 1308 | * @augments wp.media.view.Frame |
1332 | 1309 | * @augments wp.media.View |
… |
… |
|
1343 | 1320 | * @global wp.Uploader |
1344 | 1321 | */ |
1345 | 1322 | initialize: function() { |
1346 | | /** |
1347 | | * call 'initialize' directly on the parent class |
1348 | | */ |
| 1323 | |
1349 | 1324 | media.view.Frame.prototype.initialize.apply( this, arguments ); |
1350 | 1325 | |
1351 | 1326 | _.defaults( this.options, { |
… |
… |
|
1550 | 1525 | /** |
1551 | 1526 | * wp.media.view.MediaFrame.Select |
1552 | 1527 | * |
| 1528 | * Type of media frame that is used to select an item or items from the media library |
| 1529 | * |
1553 | 1530 | * @constructor |
1554 | 1531 | * @augments wp.media.view.MediaFrame |
1555 | 1532 | * @augments wp.media.view.Frame |