CoreFiles by mySites.guru
router.js36 lines, 778 bytes, from wordpress-4.2-beta2.zip
Raw History Compare with 4.2-beta1
md5
7da16fd2a4408834c901409fb8ead0b2
sha1
4fca266cb6434cb13d9763c5b846ef37a4863aa9
sha256
0cffea9e1efd01b79e3bb2ae695c6b2bc403b229a5021aae7ca15d0939ed61eb
/**
 * wp.media.view.Router
 *
 * @class
 * @augments wp.media.view.Menu
 * @augments wp.media.view.PriorityList
 * @augments wp.media.View
 * @augments wp.Backbone.View
 * @augments Backbone.View
 */
var Menu = require( './menu.js' ),
	RouterItem = require( './router-item.js' ),
	Router;

Router = Menu.extend({
	tagName:   'div',
	className: 'media-router',
	property:  'contentMode',
	ItemView:  RouterItem,
	region:    'router',

	initialize: function() {
		this.controller.on( 'content:render', this.update, this );
		// Call 'initialize' directly on the parent class.
		Menu.prototype.initialize.apply( this, arguments );
	},

	update: function() {
		var mode = this.controller.content.mode();
		if ( mode ) {
			this.select( mode );
		}
	}
});

module.exports = Router;

The same content is in 3 releases, WordPress 4.2-beta1 to 4.2-beta3. See them all, or every version of this file.