Phi: Radiostack widget improvements
- add the ADF - show station name on hover above "use frequency" input
This commit is contained in:
parent
99020d4841
commit
5808152af2
3 changed files with 12 additions and 2 deletions
|
@ -184,11 +184,15 @@ require([
|
|||
],
|
||||
// radio settings
|
||||
[
|
||||
"com1stn", "/instrumentation/comm/station-name"
|
||||
], [
|
||||
"com1use", "/instrumentation/comm/frequencies/selected-mhz"
|
||||
], [
|
||||
"com1sby", "/instrumentation/comm/frequencies/standby-mhz"
|
||||
], [
|
||||
"com1stn", "/instrumentation/comm/station-name"
|
||||
], [
|
||||
"com2stn", "/instrumentation/comm[1]/station-name"
|
||||
], [
|
||||
"com2use", "/instrumentation/comm[1]/frequencies/selected-mhz"
|
||||
], [
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="phi-radiostack" data-bind="foreach: radios">
|
||||
<div class="phi-radio">
|
||||
<span data-bind="text: label"></span>
|
||||
<input data-bind="value: use"/>
|
||||
<input data-bind="value: use, attr: { title: stn }"/>
|
||||
<button data-bind="click: swap">↔</button>
|
||||
<input data-bind="value: stby"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@ define([
|
|||
var self = this;
|
||||
self.useKey = pfx + "use";
|
||||
self.sbyKey = pfx + "sby";
|
||||
self.stnKey = pfx + "stn";
|
||||
|
||||
self.label = ko.observable(label);
|
||||
self.use = ko.observable(188.888).extend({
|
||||
|
@ -16,6 +17,10 @@ define([
|
|||
fgprop : self.sbyKey
|
||||
});
|
||||
|
||||
self.stn = ko.observable("").extend({
|
||||
fgprop : self.stnKey
|
||||
});
|
||||
|
||||
self.swap = function() {
|
||||
ko.utils.knockprops.write(self.useKey, this.stby());
|
||||
ko.utils.knockprops.write(self.sbyKey, this.use());
|
||||
|
@ -26,6 +31,7 @@ define([
|
|||
this.radios = ko.observableArray([
|
||||
new DualFrequencyViewModel("COM1", "com1"), new DualFrequencyViewModel("COM2", "com2"),
|
||||
new DualFrequencyViewModel("NAV1", "nav1"), new DualFrequencyViewModel("NAV2", "nav2"),
|
||||
new DualFrequencyViewModel("ADF", "adf1"),
|
||||
]);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue