Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / core / modules / toolbar / js / views / MenuVisualView.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Backbone, Drupal) {
9   Drupal.toolbar.MenuVisualView = Backbone.View.extend({
10     initialize: function initialize() {
11       this.listenTo(this.model, 'change:subtrees', this.render);
12     },
13     render: function render() {
14       var _this = this;
15
16       var subtrees = this.model.get('subtrees');
17
18       Object.keys(subtrees || {}).forEach(function (id) {
19         _this.$el.find('#toolbar-link-' + id).once('toolbar-subtrees').after(subtrees[id]);
20       });
21
22       if ('drupalToolbarMenu' in $.fn) {
23         this.$el.children('.toolbar-menu').drupalToolbarMenu();
24       }
25     }
26   });
27 })(jQuery, Backbone, Drupal);