fix eslint
This commit is contained in:
parent
93fa1cd03c
commit
ce8c8a755c
|
@ -117,7 +117,6 @@ function submitToEvents( element ) {
|
|||
function submitToMontageReview(element) {
|
||||
var form = element.form;
|
||||
form.action = thisUrl + '?view=montagereview';
|
||||
console.log($j(form).serialize());
|
||||
window.location.assign('?view=montagereview&'+$j(form).serialize());
|
||||
history.replaceState(null, null, '?view=montagereview&live=0&' + $j(form).serialize());
|
||||
}
|
||||
|
@ -205,14 +204,14 @@ function parseRows(rows) {
|
|||
inputTds.eq(4).html(archiveSelect).children().val(archiveVal).chosen({width: "101%"});
|
||||
} else if ( attr == 'AlarmedZoneId' ) {
|
||||
var zoneSelect = $j('<select></select>').attr('name', queryPrefix + rowNum + '][val]').attr('id', queryPrefix + rowNum + '][val]');
|
||||
for ( monitor_id in monitors ) {
|
||||
for ( zone_id in zones ) {
|
||||
var zone = zones[zone_id];
|
||||
if ( monitor_id == zone.MonitorId ) {
|
||||
zoneSelect.append('<option value="' + zone_id + '">' + zone.Name + '</option>');
|
||||
}
|
||||
} // end foreach zone
|
||||
} // end foreach monitor
|
||||
for ( monitor_id in monitors ) {
|
||||
for ( zone_id in zones ) {
|
||||
var zone = zones[zone_id];
|
||||
if ( monitor_id == zone.MonitorId ) {
|
||||
zoneSelect.append('<option value="' + zone_id + '">' + zone.Name + '</option>');
|
||||
}
|
||||
} // end foreach zone
|
||||
} // end foreach monitor
|
||||
var zoneVal = inputTds.eq(4).children().val();
|
||||
inputTds.eq(4).html(zoneSelect).children().val(zoneVal).chosen({width: "101%"});
|
||||
} else if ( attr.indexOf('Weekday') >= 0 ) { //Weekday selection
|
||||
|
@ -250,24 +249,24 @@ function parseRows(rows) {
|
|||
}
|
||||
var monitorVal = inputTds.eq(4).children().val();
|
||||
inputTds.eq(4).html(monitorSelect).children().val(monitorVal);
|
||||
} else { // Reset to regular text field and operator for everything that isn't special
|
||||
} else { // Reset to regular text field and operator for everything that isn't special
|
||||
var textInput = $j('<input></input>').attr('type', 'text').attr('name', queryPrefix + rowNum + '][val]').attr('id', queryPrefix + rowNum + '][val]');
|
||||
var textVal = inputTds.eq(4).children().val();
|
||||
inputTds.eq(4).html(textInput).children().val(textVal);
|
||||
}
|
||||
|
||||
// Validate the operator
|
||||
var opSelect = $j('<select></select>').attr('name', queryPrefix + rowNum + '][op]').attr('id', queryPrefix + rowNum + '][op]');
|
||||
var opVal = inputTds.eq(3).children().val();
|
||||
if ( ! opVal ) {
|
||||
// Default to equals so that something gets selected
|
||||
console.log("No value for operator. Defaulting to =");
|
||||
opVal = '=';
|
||||
}
|
||||
for ( var key in opTypes ) {
|
||||
opSelect.append('<option value="' + key + '"'+(key == opVal ? ' selected="selected"' : '')+'>' + opTypes[key] + '</option>');
|
||||
}
|
||||
inputTds.eq(3).html(opSelect).children().val(opVal).chosen({width: "101%"});
|
||||
// Validate the operator
|
||||
var opSelect = $j('<select></select>').attr('name', queryPrefix + rowNum + '][op]').attr('id', queryPrefix + rowNum + '][op]');
|
||||
var opVal = inputTds.eq(3).children().val();
|
||||
if ( ! opVal ) {
|
||||
// Default to equals so that something gets selected
|
||||
console.log("No value for operator. Defaulting to =");
|
||||
opVal = '=';
|
||||
}
|
||||
for ( var key in opTypes ) {
|
||||
opSelect.append('<option value="' + key + '"'+(key == opVal ? ' selected="selected"' : '')+'>' + opTypes[key] + '</option>');
|
||||
}
|
||||
inputTds.eq(3).html(opSelect).children().val(opVal).chosen({width: "101%"});
|
||||
if ( attr.endsWith('DateTime') ) { //Start/End DateTime
|
||||
inputTds.eq(4).children().datetimepicker({timeFormat: "HH:mm:ss", dateFormat: "yy-mm-dd", maxDate: 0, constrainInput: false});
|
||||
} else if ( attr.endsWith('Date') ) { //Start/End Date
|
||||
|
@ -301,7 +300,7 @@ function addTerm( element ) {
|
|||
var newRow = row.clone().insertAfter(row);
|
||||
row.find('select').chosen({width: '101%'});
|
||||
newRow.find('select').each( function() { //reset new row to default
|
||||
this[0].selected = 'selected';
|
||||
this[0].selected = 'selected';
|
||||
}).chosen({width: '101%'});
|
||||
newRow.find('input[type="text"]').val('');
|
||||
newRow[0].querySelectorAll("button[data-on-click-this]").forEach(function(el) {
|
||||
|
|
Loading…
Reference in New Issue