annotate core/modules/toolbar/js/views/MenuVisualView.js @ 9:1fc0ff908d1f

Add another data file
author Chris Cannam
date Mon, 05 Feb 2018 12:34:32 +0000
parents 4c8ae668cc8c
children 1fec387a4317
rev   line source
Chris@0 1 /**
Chris@0 2 * DO NOT EDIT THIS FILE.
Chris@0 3 * See the following change record for more information,
Chris@0 4 * https://www.drupal.org/node/2815083
Chris@0 5 * @preserve
Chris@0 6 **/
Chris@0 7
Chris@0 8 (function ($, Backbone, Drupal) {
Chris@0 9 Drupal.toolbar.MenuVisualView = Backbone.View.extend({
Chris@0 10 initialize: function initialize() {
Chris@0 11 this.listenTo(this.model, 'change:subtrees', this.render);
Chris@0 12 },
Chris@0 13 render: function render() {
Chris@0 14 var subtrees = this.model.get('subtrees');
Chris@0 15
Chris@0 16 for (var id in subtrees) {
Chris@0 17 if (subtrees.hasOwnProperty(id)) {
Chris@0 18 this.$el.find('#toolbar-link-' + id).once('toolbar-subtrees').after(subtrees[id]);
Chris@0 19 }
Chris@0 20 }
Chris@0 21
Chris@0 22 if ('drupalToolbarMenu' in $.fn) {
Chris@0 23 this.$el.children('.toolbar-menu').drupalToolbarMenu();
Chris@0 24 }
Chris@0 25 }
Chris@0 26 });
Chris@0 27 })(jQuery, Backbone, Drupal);