neater html, no overlapping chromebooks/serials
This commit is contained in:
parent
e096b7eb7c
commit
4b924fc30e
@ -28,7 +28,7 @@
|
||||
<!-- Carts -->
|
||||
<div class="border">
|
||||
<div>
|
||||
<h6> Edit Carts</h6> <!-- Editing Carts -->
|
||||
<h6> Edit Carts</h6> <!-- Edit Carts -->
|
||||
{{#momentum plugin='slide-fade'}}
|
||||
{{#each carts}}
|
||||
<div class="row-admin">
|
||||
|
||||
@ -26,6 +26,21 @@ Template.admin.events({
|
||||
|
||||
var chromebook_number = $("input[name='anumber']")[0].value;
|
||||
var chromebook_serial = $("input[name='aserial']")[0].value;
|
||||
var currNumbers = Chromebooks.find({ number: chromebook_number }).fetch();
|
||||
var currSerials = Chromebooks.find({ serial: chromebook_serial }).fetch();
|
||||
|
||||
if(currNumbers.length !== 0) {
|
||||
alert("That Chromebook already exists!");
|
||||
$("input[name='anumber']")[0].value = "";
|
||||
$("input[name='anumber']")[0].focus();
|
||||
throw new Error("That Chromebook already exists!");
|
||||
}
|
||||
if(currSerials.length !== 0) {
|
||||
alert("That serial number already exists!");
|
||||
$("input[name='aserial']")[0].value = "";
|
||||
$("input[name='aserial']").focus();
|
||||
throw new Error("That serial number already exists!");
|
||||
}
|
||||
|
||||
if (!((chromebook_number === "") || (chromebook_serial === "")))
|
||||
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
<p class="user"> <b>{{user}}</b></p>
|
||||
<p class="time">{{time_ago}}</p>
|
||||
</div>
|
||||
<!-- <div class="cross pure-u-2-5">
|
||||
<i class="fa fa-times"></i>
|
||||
</div> -->
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
@ -2,6 +2,5 @@
|
||||
<title>IA Chromebook Checkout</title>
|
||||
<link rel="icon" href="ico/favicon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
|
||||
@ -11,6 +11,7 @@ Momentum.registerPlugin('slide-fade', function(options) {
|
||||
$node
|
||||
.hide()
|
||||
.insertBefore(next)
|
||||
.css('height', $node.height())
|
||||
.velocity('fadeIn')
|
||||
.velocity('slideDown', {
|
||||
easing: options.easing,
|
||||
@ -31,6 +32,7 @@ Momentum.registerPlugin('slide-fade', function(options) {
|
||||
easing: options.easing,
|
||||
duration: options.duration,
|
||||
complete: function() {
|
||||
$node.velocity('fadeOut');
|
||||
$node.remove();
|
||||
done();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user