Unverified Commit e22a0350 authored by bitsoko's avatar bitsoko Committed by GitHub

Merge pull request #58 from bitsoko-services/master

updates
parents d521efa1 4d5ae12b
......@@ -28,6 +28,20 @@ body {
cursor: default;
}
.switchStoreHeader {
margin: 0px;
position: fixed;
height: 75px;
}
.swtchTabs {
height: 50px !important;
position: fixed;
z-index: 1;
margin-top: 75px;
left: 0px;
}
.modal {
/* height: 80% !important; */
margin-top: 0px !important;
......
......@@ -250,7 +250,7 @@
</div>
-->
<div class="modal-content" style="padding:0px;">
<div class="row selectedColor switchStoreHeader" style="margin: 0px;">
<div class="row selectedColor switchStoreHeader">
<div class="col s7">
<h5 style="margin:0px;">SWITCH STORE</h5>
<p style="margin:0px;">STORES: <span id="storeNo"></span></p>
......@@ -259,19 +259,19 @@
<a class="btn bits right" style="padding: 0px 10px; background: green; font-size: 2.3em; border-radius: 50%; height: 40px; width: 40px; line-height: 40px;" onclick='$("#switchStoreModal").modal("close"); $("#newStoreModal").modal("open")'>+</a>
</div>
</div>
<div style="padding:0px 10px;" class="swtchStrDskt">
<div style="" class="swtchStrDskt">
<div class="row switchStoreDiv">
<div class="col s12">
<ul class="tabs" style="height: 50px;">
<li class="tab col s3"><a style="color:black;" href="#myStores">My Stores</a></li>
<li class="tab col s3"><a style="color:black;" class="active" href="#managedStores">Managed Stores</a></li>
<ul class="tabs selectedColor swtchTabs">
<li class="tab col s3"><a style="color:white;" href="#myStores">My Stores</a></li>
<li class="tab col s3"><a style="color:white;" class="active" href="#managedStores">Managed Stores</a></li>
</ul>
</div>
<div id="myStores" class="col s12">
<ul id="myStoreContent" class="collection" style="text-align:center;"></ul>
<ul id="myStoreContent" class="collection" style="text-align:center; margin-top: 145px;"></ul>
</div>
<div id="managedStores" class="col s12">
<ul id="managedStoreContent" class="collection" style="text-align:center;"></ul>
<ul id="managedStoreContent" class="collection" style="text-align:center; margin-top: 145px;"></ul>
</div>
</div>
</div>
......@@ -3242,7 +3242,7 @@
</div>
<ul class="sponsoredPrd-collapsible collapsible collapsible-accordion chStoreUpdate" data-collapsible="accordion" style="background:white; margin: 10px;"> </ul>
<div class="fixed-action-btn direction-top active">
<a onclick="$('#spnsrdModal').modal('open')" class="btn-floating opacitySelectedColor" style="width: 55px; height: 55px; border-radius: 50%; line-height: 55px; font-size: 2em;">
<a id="inventoryAddBtn" onclick="$('#spnsrdModal').modal('open'); document.getElementById('inventoryAddBtn').classList.remove('pulse')" class="btn-floating opacitySelectedColor" style="width: 55px; height: 55px; border-radius: 50%; line-height: 55px; font-size: 2em;">
<p style="margin-top:0px !important;text-align:center;">+</p>
</a>
</div>
......
......@@ -72,10 +72,6 @@ function profileLoaded(p) {
$('.profile-image').attr('src', p.image);
//p.ownerid=1;
localStorage.setItem('soko-owner-id', p.bitsokoUserID);
M.toast({
html: 'Signing in...',
displayLength: 3000
})
$("#signingIn").html("Signing In. Please Wait");
updateStores();
......
......@@ -120,6 +120,7 @@ angular.module('sokoApp', [])
}
if (getBitsWinOpt('page') == 'inventory') {
openInventoryPage();
isInventoryActive()
if(getBitsWinOpt('sel')=="add"){
$('#spnsrdModal').modal('open');
}
......
var inventoryItemsActive = false
function openInventoryPage() {
$('#content > .container > div').css('display', 'none');
setTimeout(function(e) {
......@@ -7,6 +9,20 @@ function openInventoryPage() {
sponpProdNamesInput();
}
function isInventoryActive() {
getObjectStore('data', 'readwrite').get('soko-store-' + localStorage.getItem('soko-active-store') + '-products').onsuccess = function(event) {
var reqs = JSON.parse(event.target.result);
for (var i = 0; i < reqs.length; ++i) {
if (reqs[i].sponsored == "true") {
inventoryItemsActive = true
}
}
if (inventoryItemsActive != true) {
document.getElementById('inventoryAddBtn').classList.add('pulse')
}
}
}
//Input Initiallization
var sponProds = {}
......@@ -27,12 +43,9 @@ function sponpProdNamesInput() {
var itemPrice = sponProds[iii].price;
var itemId = sponProds[iii].id;
var itemIcon = sponProds[iii].icon;
if (itemName.toLowerCase() == "eggs") {
$('.inventoryItemsToAdd').append('<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="' + itemId + '" id="inventoryItem' + itemId + '"/> <span><img src="' + itemIcon + '" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">' + itemName + ' @ ' + itemPrice + ' per tray</span> </label> </p></form>');
}
if (itemName.toLowerCase() == "potatoes") {
$('.inventoryItemsToAdd').append('<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="' + itemId + '" id="inventoryItem' + itemId + '"/> <span><img src="' + itemIcon + '" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">' + itemName + ' @ ' + itemPrice + ' per kg</span> </label> </p></form>');
}
var itemMetric = sponProds[iii].metric;
$('.inventoryItemsToAdd').append('<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="' + itemId + '" id="inventoryItem' + itemId + '"/> <span><img src="' + itemIcon + '" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">' + itemName + ' @ ' + itemPrice + ' ' + itemMetric + '</span> </label> </p></form>');
if (invetoryItemsInStore.includes(itemId) == true) {
$('#inventoryItem' + itemId + '').attr('checked', true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment