Browse Source

UI-2704: Return `null` for unset keys (#25)

4.3
Joris Tirado 9 years ago
committed by GitHub
parent
commit
8608ea718b
2 changed files with 11 additions and 17 deletions
  1. +11
    -11
      submodules/devices/devices.js
  2. +0
    -6
      views/devices-sip_device.html

+ 11
- 11
submodules/devices/devices.js View File

@ -324,14 +324,16 @@ define(function(require) {
var section = '.tabs-section[data-section="' + value.type + '"] ';
_.each(value.data, function(val, key) {
var groupSelector = '.control-group[data-id="' + key + '"] ',
valueSelector = '.feature-key-value[data-type="' + val.type + '"]';
templateDevice
.find(section.concat(groupSelector, valueSelector))
.addClass('active')
.find('[name="provision.keys.' + value.id + '[' + key + '].value"]')
.val(val.value);
if (val) {
var groupSelector = '.control-group[data-id="' + key + '"] ',
valueSelector = '.feature-key-value[data-type="' + val.type + '"]';
templateDevice
.find(section.concat(groupSelector, valueSelector))
.addClass('active')
.find('[name="provision.keys.' + value.id + '[' + key + '].value"]')
.val(val.value);
}
});
});
@ -665,9 +667,7 @@ define(function(require) {
var keys = {};
list[key].forEach(function(val, idx) {
if (val.type !== 'none') {
keys[idx] = val;
}
keys[idx] = val.type === 'none' ? null : val;
});
if (_.isEmpty(keys)) {


+ 0
- 6
views/devices-sip_device.html View File

@ -347,12 +347,6 @@
<label for="provision.keys.{{../id}}[{{@key}}].value">{{ @root.i18n.devices.popupSettings.keys.labels.value }}</label>
<input type="text" value="" name="provision.keys.{{../id}}[{{@key}}].value">
</div>
{{#compare id '===' 'combo_keys'}}
{{#compare @key '===' '0'}}
{{#if @root.extra.firstComboKeyUnset}}
{{/if}}
{{/compare}}
{{/compare}}
</div>
</div>
{{/each}}


Loading…
Cancel
Save