blob: fd5e7713fb1f92b5e0a1354caa24e8879775fe28 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import { View } from 'libs/mvc/view'
/*
* View showing a list of all p2b services from the namespace
* @class
* @extends {View}
*/
export class NamespaceListView extends View {
constructor(items) {
var el = document.createElement('p2b-namespace-list');
el.items = items;
super(el);
}
/*
* Event that fires when user selects an item from the list.
* @event
* @type {string} name of the item that was selected
*/
onSelectAction(eventHandler) {
this.element.addEventListener('select', (e) => {
eventHandler(e.detail);
});
}
}