Changeset 29813
- Timestamp:
- 10/02/2014 04:31:07 AM (10 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29811 r29813 730 730 }); 731 731 732 /**733 * A filter dropdown for month/dates.734 */735 media.view.DateFilter = media.view.AttachmentFilters.extend({736 id: 'media-attachment-date-filters',737 738 createFilters: function() {739 var filters = {};740 _.each( media.view.settings.months || {}, function( value, index ) {741 filters[ index ] = {742 text: value.text,743 props: {744 year: value.year,745 monthnum: value.month746 }747 };748 });749 filters.all = {750 text: l10n.allDates,751 props: {752 monthnum: false,753 year: false754 },755 priority: 10756 };757 this.filters = filters;758 }759 });760 761 732 }(jQuery, _, Backbone, wp)); -
trunk/src/wp-includes/js/media-views.js
r29812 r29813 5751 5751 5752 5752 /** 5753 * A filter dropdown for month/dates. 5754 * 5755 * @constructor 5756 * @augments wp.media.view.AttachmentFilters 5757 * @augments wp.media.View 5758 * @augments wp.Backbone.View 5759 * @augments Backbone.View 5760 */ 5761 media.view.DateFilter = media.view.AttachmentFilters.extend({ 5762 id: 'media-attachment-date-filters', 5763 5764 createFilters: function() { 5765 var filters = {}; 5766 _.each( media.view.settings.months || {}, function( value, index ) { 5767 filters[ index ] = { 5768 text: value.text, 5769 props: { 5770 year: value.year, 5771 monthnum: value.month 5772 } 5773 }; 5774 }); 5775 filters.all = { 5776 text: l10n.allDates, 5777 props: { 5778 monthnum: false, 5779 year: false 5780 }, 5781 priority: 10 5782 }; 5783 this.filters = filters; 5784 } 5785 }); 5786 5787 /** 5753 5788 * wp.media.view.AttachmentFilters.Uploaded 5754 5789 * … … 6111 6146 } 6112 6147 6148 } else { 6149 // DateFilter is a <select>, screen reader text needs to be rendered before 6150 this.toolbar.set( 'dateFilterLabel', new media.view.Label({ 6151 value: l10n.filterByDate, 6152 attributes: { 6153 'for': 'media-attachment-date-filters' 6154 }, 6155 priority: -75 6156 }).render() ); 6157 this.toolbar.set( 'dateFilter', new media.view.DateFilter({ 6158 controller: this.controller, 6159 model: this.collection.props, 6160 priority: -75 6161 }).render() ); 6113 6162 } 6114 6163
Note: See TracChangeset
for help on using the changeset viewer.