OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 'use strict'; |
| 6 |
| 7 base.require('ui'); |
| 8 base.require('ui.list_and_associated_view'); |
| 9 base.require('layer_impl_view'); |
| 10 base.requireStylesheet('layer_tree_impl_view'); |
| 11 base.exportTo('ccfv', function() { |
| 12 var LayerTreeImplView = ui.define('x-layer-tree-impl-view'); |
| 13 LayerTreeImplView.prototype = { |
| 14 __proto__: HTMLUnknownElement.prototype, |
| 15 |
| 16 decorate: function() { |
| 17 this.layer_tree_impl_ = undefined; |
| 18 this.layerListEl_ = new ui.ListAndAssociatedView(); |
| 19 this.layerListEl_.view = new ccfv.LayerImplView(); |
| 20 this.layerListEl_.viewProperty = 'layerImpl'; |
| 21 this.layerListEl_.listProperty = 'title'; |
| 22 |
| 23 this.headerEl_ = ui.createSpan('') |
| 24 this.appendChild(this.headerEl_); |
| 25 this.appendChild(this.layerListEl_); |
| 26 }, |
| 27 |
| 28 set header(text) { |
| 29 this.headerEl_.textContent = text; |
| 30 }, |
| 31 |
| 32 set layerTreeImpl(layerTreeImpl) { |
| 33 this.layerTreeImpl_ = layerTreeImpl; |
| 34 this.updateChildren_(); |
| 35 }, |
| 36 |
| 37 updateChildren_: function() { |
| 38 this.layerListEl_.list = this.layerTreeImpl_.allLayers; |
| 39 } |
| 40 }; |
| 41 |
| 42 return { |
| 43 LayerTreeImplView: LayerTreeImplView, |
| 44 } |
| 45 }); |
| 46 |
OLD | NEW |