Mercurial > hg > isophonics-drupal-site
comparison core/modules/toolbar/js/views/MenuVisualView.js @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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 subtrees = this.model.get('subtrees'); | |
15 | |
16 for (var id in subtrees) { | |
17 if (subtrees.hasOwnProperty(id)) { | |
18 this.$el.find('#toolbar-link-' + id).once('toolbar-subtrees').after(subtrees[id]); | |
19 } | |
20 } | |
21 | |
22 if ('drupalToolbarMenu' in $.fn) { | |
23 this.$el.children('.toolbar-menu').drupalToolbarMenu(); | |
24 } | |
25 } | |
26 }); | |
27 })(jQuery, Backbone, Drupal); |