Updated JQuery; Added resize sensor library; Updated the admin code (prior to changing gears to use Meteor).

This commit is contained in:
Wynne Crisman
2016-12-28 11:13:44 -08:00
parent 801c0507e5
commit 00f2be30ce
58 changed files with 29553 additions and 252 deletions

View File

@@ -21,8 +21,7 @@
<th data-key-name="name">Name</th>
<th data-key-name="category">Category</th>
<th data-key-name="subcategory">Subcategory</th>
<th data-key-name="defaultPrice">Default Price</th>
<th data-key-name="measures">Measures</th>
<th data-key-name="prices">Prices</th>
<th data-key-name="aliases">Aliases</th>
</tr>
</thead>
@@ -38,29 +37,35 @@
<h4 class="modal-title"></h4>
</div>
<form role="form" autocomplete="off">
<div class="modal-body">
<label for="DFName">Name</label>
<div class="form-group">
<input name="name" id="DFName" type="text" class="form-control" tabindex="0" placeholder="Strawberry Jam" required>
<div class="modal-body row">
<div class="col-sm-6">
<label for="DFName">Name</label>
<div class="form-group">
<input name="name" id="DFName" type="text" class="form-control" tabindex="0" placeholder="Strawberry Jam" required>
</div>
<label for="DFSubcategory">Subcategory</label>
<div class="form-group">
<input name="subcategoryId" id="DFSubcategoryId" type="hidden"/>
<input name="subcategory" id="DFSubcategory" class="form-control" type="text" tabindex="0" required/>
</div>
<label for="DFMeasures">Measures</label>
<div class="form-group">
<select class="js-states form-control" name="measures" id="DFMeasures" multiple="multiple" tabindex="0" style="width: 100%;" required></select>
</div>
</div>
<label for="DFSubcategory">Subcategory</label>
<div class="form-group">
<input name="subcategoryId" id="DFSubcategoryId" type="hidden"/>
<input name="subcategory" id="DFSubcategory" class="form-control" type="text" tabindex="0" required/>
</div>
<label for="DFPrice">Default Price</label>
<div class="input-group">
<span class="input-group-addon">$</span><input name="defaultPrice" id="DFPrice" type="number" min="0.00" step="0.50" value="10.00" data-number-to-fixed="2" class="form-control currency" tabindex="0" required>
</div>
<label for="DFMeasures">Measures</label>
<div class="form-group">
<select class="js-states form-control" name="measures" id="DFMeasures" multiple="multiple" tabindex="0" style="width: 100%;" required></select>
</div>
<label for="DFNewAlias">Aliases</label>
<div class="input-group">
<input name="newAlias" id="DFNewAlias" type="text" class="form-control text" tabindex="0"><span class="input-group-btn"><button id="DFNewAliasAdd" class="btn" type="button">Add</button></span>
</div>
<div id="DFAliases" class="list-group" tabindex="0">
<div class="col-sm-6">
<label for="DFNewAlias">Aliases</label>
<div class="input-group">
<input name="newAlias" id="DFNewAlias" type="text" class="form-control text" tabindex="0"><span class="input-group-btn"><button id="DFNewAliasAdd" class="btn" type="button">Add</button></span>
</div>
<div id="DFAliases" class="form-control list-group" tabindex="0">
</div>
<!--<label>Prices</label>-->
<!--<div class="input-group">-->
<!--<span class="metric">8oz Jars</span> <span class="input-group-addon">$</span><input type="number" min="0.00" step="0.50" value="11.00" data-number-to-fixed="2" class="form-control currency" tabindex="0" required>-->
<!--<span class="metric">16oz Jars</span> <span class="input-group-addon">$</span><input type="number" min="0.00" step="0.50" value="11.00" data-number-to-fixed="2" class="form-control currency" tabindex="0" required>-->
<!--<span class="metric">32oz Jars</span> <span class="input-group-addon">$</span><input type="number" min="0.00" step="0.50" value="11.00" data-number-to-fixed="2" class="form-control currency" tabindex="0" required>-->
<!--</div>-->
</div>
</div>
<div class="modal-footer">
@@ -125,7 +130,7 @@ $(function() {
};
var $table = $page.find('#dataTable');
var dataTable = new LinkedTable($table, {
$table.buildTable({
url: "data/Item/readAll",
attr: "data-key-name",
selection: "row",
@@ -192,6 +197,8 @@ $(function() {
}
}
});
var dataTable = $table.getTable();
$page.find('#dataTable').on('dblclick', 'tr', function(event) {
if(dataTable.getSelectedRow()) {
location.hash = "#!/items-edit";
@@ -264,7 +271,7 @@ $(function() {
//Initialize the measures selector.
$editorForm.find('#DFMeasures').select2({data: measureData}).focus(function() {$(this).select2('focus')});
//Initialize the drop down menu.
$editorForm.find("#DFSubcategory").buildEditableSelect(query1[0], {textAttr: 'name', listClass: 'comboList', groupFunctions: {
$editorForm.find("#DFSubcategory").buildCombo(query1[0], {textAttr: 'name', listClass: 'comboList', groupFunctions: {
groupParents: function(category) {
return category;
},
@@ -315,9 +322,9 @@ $(function() {
$editorView.find(".modal-title").text("Edit Item");
//Reset fields to selected values.
$editorView.find('#DFName').val(model.name);
$editorView.find('#DFSubcategory').val(model.subcategoryId);
$editorView.find('#DFSubcategoryId').val(model.subcategoryId).trigger("change");
$editorView.find('#DFPrice').val(model.defaultPrice);
$editorView.find('#DFMeasures').val(model.measures);
$editorView.find('#DFMeasures').val(model.measures).trigger("change");
$editorView.find('#DFAliases').empty();
if(model.aliases && model.aliases.length) {
@@ -484,7 +491,7 @@ $(function() {
switch(event.keyCode) {
case 27:
if(!event.isDefaultPrevented())
location.href='#!/items';
history.back();
break;
}
});