Skip to content

Commit

Permalink
Added Spin in icons
Browse files Browse the repository at this point in the history
  • Loading branch information
parthshahk committed Nov 14, 2018
1 parent 4f940e8 commit f9f0fa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ function addToCart(id){
button.classList.add("amber");
icon.classList.remove("fa-cart-plus");
icon.classList.add("fa-refresh");
icon.classList.add("fa-spin");

if(buttonText !== null){
buttonText.innerText = "Working";
Expand All @@ -229,6 +230,7 @@ function addToCart(id){
button.classList.remove("amber");
button.classList.add("green","z-depth-0");
icon.classList.remove("fa-refresh");
icon.classList.remove("fa-spin");
icon.classList.add("fa-check");

if(buttonText !== null){
Expand Down Expand Up @@ -296,7 +298,7 @@ function updateCartAmount(){

function quantityIncrease(id){

document.getElementById("quantity"+id).innerHTML = '<i class="fa fa-cogs" aria-hidden="true"></i>';
document.getElementById("quantity"+id).innerHTML = '<i class="fa fa-cog fa-spin" aria-hidden="true"></i>';

var request = new XMLHttpRequest();
request.onload = function(){
Expand All @@ -311,7 +313,7 @@ function quantityIncrease(id){

function quantityDecrease(id){

document.getElementById("quantity"+id).innerHTML = '<i class="fa fa-cogs" aria-hidden="true"></i>';
document.getElementById("quantity"+id).innerHTML = '<i class="fa fa-cog fa-spin" aria-hidden="true"></i>';

var request = new XMLHttpRequest();
request.onload = function(){
Expand Down
2 changes: 1 addition & 1 deletion js/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f9f0fa3

Please sign in to comment.