radio/libjs/wController/link.js

37 lines
869 B
JavaScript
Raw Permalink Normal View History

2018-08-04 21:46:25 +00:00
"use strict";
var Controller = require("./controller");
var String = require("./string");
var Address = require("../wType/address");
var Link = Controller.inherit({
"className": "Link",
"constructor": function(addr) {
Controller.fn.constructor.call(this, addr);
this.targetAddress = new Address([]);
this.label = new String(addr['+'](hop));
this.addController(this.label);
this.addHandler("get");
},
"destructor": function() {
this.targetAddress.destructor();
Controller.fn.destructor.call(this);
},
"_h_get": function(ev) {
var data = ev.getData();
this.targetAddress = data.at("targetAddress").clone();
this.trigger("data", this.targetAddress);
}
});
2018-08-04 21:52:16 +00:00
var hop = new Address(["label"]);
2018-08-04 21:46:25 +00:00
module.exports = Link;