diff --git a/src/Config.php b/src/Config.php index 90b55d0..bc6febf 100644 --- a/src/Config.php +++ b/src/Config.php @@ -3,8 +3,8 @@ namespace WebProjectFitness; class Config { - const SITE_JS_VERSION = '1.04'; - const SITE_CSS_VERSION = '1.04'; + const SITE_JS_VERSION = '1.05'; + const SITE_CSS_VERSION = '1.05'; const TITLE_HEADER = 'Fitness'; const DESCRIPTION_HEADER = 'Site for find all the fitness exercise you need'; diff --git a/static/js/javascript.js b/static/js/javascript.js index 387ef20..72a6c50 100644 --- a/static/js/javascript.js +++ b/static/js/javascript.js @@ -246,7 +246,7 @@ let Point = ( function () { let fav = favStorage[ $elem.data( "id" ) ]; main.html( ` -
+

${ data.title }

@@ -275,10 +275,11 @@ let Point = ( function () { favStorage = {}; } - if ( $elem.data( "fav" ) === "true" ) { + console.log( $elem ); + if ( $elem.attr( "data-fav" ) === "true" ) { favStorage[ $elem.data( "id" ) ] = false; $elem.find( "img" ).attr( "src", "/img/no-favorite.png" ); - $elem.data( "fav", "false" ); + $elem.attr( "data-fav", "false" ); $.ajax( { url: "/api/user/favorite-delete", method: "POST", @@ -289,7 +290,7 @@ let Point = ( function () { } ); } else { favStorage[ $elem.data( "id" ) ] = true; - $elem.data( "fav", "true" ); + $elem.attr( "data-fav", "true" ); $elem.find( "img" ).attr( "src", "/img/favorite.png" ); $.ajax( { url: "/api/user/favorite-add", @@ -400,7 +401,7 @@ $( document ).ready( () => { if ( favStorage[ id ] ) { if ( exercisesStorage.hasOwnProperty( id ) ) { main.append( ` -
+

${ exercisesStorage[ id ].title }