2020-11-19 22:47:44 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
function newExtra(id, name, price) {
|
|
|
|
var extra = {
|
|
|
|
id:id,
|
|
|
|
name:name,
|
|
|
|
price: price,
|
|
|
|
createTableStructureLine:function (depth,audiofiles) {
|
|
|
|
if (id != null) {
|
|
|
|
var trline = "<tr id='extra_" + id + "'>"
|
|
|
|
+ "<td><input id='extraname_" + id + "' type='text' class='extraname'></input>"
|
|
|
|
+ "<td><input id='extraprice_" + id + "' type='text' class='extraprice'></input>"
|
|
|
|
+ "<td><button id='delextra_" + id + "' class='extracmd'>−</button>"
|
|
|
|
+ "<td><button id='applyextra_" + id + "' class='extracmd'>↵</button>"
|
2020-11-19 23:02:57 +01:00
|
|
|
+ "<td><button id='upextra_" + id + "' class='extracmd'>↑</button>"
|
2020-11-19 22:47:44 +01:00
|
|
|
+ "</tr>";
|
|
|
|
return trline;
|
|
|
|
} else {
|
|
|
|
var trline = "<tr id='extra_new_" + id + "'>"
|
|
|
|
+ "<td><input id='newextraname' type='text' class='extraname'></input>"
|
|
|
|
+ "<td><input id='newextraprice' type='text' class='extraprice'></input>"
|
|
|
|
+ "<td><button id='newextra_0' class='extracmd'>+</button>"
|
|
|
|
+ "</tr>";
|
|
|
|
return trline;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
insertValuesIntoMenuTable:function() {
|
|
|
|
$("#extra_" + this.id + " input.extraname").val(this.name);
|
|
|
|
if (this.price != null) {
|
|
|
|
$("#extra_" + this.id + " input.extraprice").val(this.price);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
createApplyArea:function(idApply) {
|
|
|
|
var txt = '<p><fieldset>'
|
|
|
|
+ '<div><button id="' + idApply + '" type="submit" data-theme="b" class="extracmd" data-icon="check">' + PROD_APPLY[lang] + '</button></div>'
|
|
|
|
+ '</fieldset></p>';
|
|
|
|
return txt;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
return extra;
|
|
|
|
}
|