fix save button in controlpreset modal
This commit is contained in:
parent
802e439cb5
commit
a97e526298
|
@ -38,7 +38,7 @@ for ( $i = 1; $i <= $monitor['NumPresets']; $i++ ) {
|
||||||
<input type="hidden" name="action" value="control"/>
|
<input type="hidden" name="action" value="control"/>
|
||||||
<input type="hidden" name="control" value="presetSet"/>
|
<input type="hidden" name="control" value="presetSet"/>
|
||||||
<input type="hidden" name="showControls" value="1"/>
|
<input type="hidden" name="showControls" value="1"/>
|
||||||
<p><?php echo buildSelect('preset', $presets, 'updateLabel()' ) ?></p>
|
<p><?php echo buildSelect('preset', $presets, 'updatePresetLabels()' ) ?></p>
|
||||||
<p>
|
<p>
|
||||||
<label for="newLabel"><?php echo translate('NewLabel') ?></label>
|
<label for="newLabel"><?php echo translate('NewLabel') ?></label>
|
||||||
<input type="text" name="newLabel" id="newLabel" value=""/>
|
<input type="text" name="newLabel" id="newLabel" value=""/>
|
||||||
|
@ -46,7 +46,7 @@ for ( $i = 1; $i <= $monitor['NumPresets']; $i++ ) {
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="submit" class="btn btn-primary" value="Save"><?php echo translate('Save') ?></button>
|
<button type="submit" class="btn btn-primary" id="cPresetSubmitModal" value="Save"><?php echo translate('Save') ?></button>
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo translate('Cancel') ?></button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo translate('Cancel') ?></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -36,6 +36,6 @@ if ( $action == 'control' ) {
|
||||||
|
|
||||||
$ctrlCommand = buildControlCommand($monitor);
|
$ctrlCommand = buildControlCommand($monitor);
|
||||||
$monitor->sendControlCommand($ctrlCommand);
|
$monitor->sendControlCommand($ctrlCommand);
|
||||||
$view = 'none';
|
$redirect = $_SERVER['HTTP_REFERER'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -816,7 +816,7 @@ function reloadWebSite() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePresetLabels() {
|
function updatePresetLabels() {
|
||||||
var form = $('contentForm');
|
var form = $('ctrlPresetForm');
|
||||||
var preset_ddm = form.elements['preset'];
|
var preset_ddm = form.elements['preset'];
|
||||||
|
|
||||||
var presetIndex = preset_ddm[preset_ddm.selectedIndex].value;
|
var presetIndex = preset_ddm[preset_ddm.selectedIndex].value;
|
||||||
|
@ -836,6 +836,11 @@ function getCtrlPresetModal() {
|
||||||
$j("body").append(data.html);
|
$j("body").append(data.html);
|
||||||
}
|
}
|
||||||
updatePresetLabels();
|
updatePresetLabels();
|
||||||
|
// Manage the Save button
|
||||||
|
$j('#cPresetSubmitModal').click(function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
$j('#ctrlPresetForm').submit();
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.fail(logAjaxFail);
|
.fail(logAjaxFail);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue