From: Anthony Talarico Date: Tue, 24 Jul 2018 17:42:59 +0000 (-0400) Subject: handling duplicate ids in login and registration forms with javascript and removing... X-Git-Tag: v1.0.0^2~29 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=2c25e27e173768e1e21ae848bf3057f61e86af8c;p=WP-Themes%2Fsaultstemarie360.git handling duplicate ids in login and registration forms with javascript and removing get started card from the courses page --- diff --git a/header.php b/header.php index dad750f..44a94d7 100644 --- a/header.php +++ b/header.php @@ -20,22 +20,26 @@ + +post_title)); + $type =strtolower(str_replace(" ","-",$post->post_type)); +?> -post_title)); - $type =strtolower(str_replace(" ","-",$post->post_type)); -?> data-page=""> - + + +
diff --git a/js/custom.js b/js/custom.js index 35b6a8d..4a670d5 100644 --- a/js/custom.js +++ b/js/custom.js @@ -151,6 +151,40 @@ jQuery(document).ready(function($){ } $('.cmvl-title').insertAfter('.cmvl-navbar'); + + if(window.page === 'registration'){ + + $("#modal-login").find('input').each(function(){ + if( $(this)[0].id ){ + $(this).attr('data-id', $(this).attr('id')); + $(this).removeAttr('id'); + } + }) + + $('.login-modal').on("click", function(){ + $("#modal-login").find('input').each(function(){ + if( !$(this)[0].id ){ + $(this).attr('data-id', $(this).attr('id')); + $(this).attr('id', $(this).data('id')); + }else{ + $(this).attr('data-id', $(this).attr('id')); + $(this).removeAttr('id'); + } + }) + + $('#registerform').find('input').each(function(){ + if( $(this)[0].id ){ + $(this).attr('data-id', $(this).attr('id')); + $(this).removeAttr('id'); + }else{ + $(this).attr('data-id', $(this).attr('id')); + $(this).attr('id', $(this).data('id')); + } + }) + }) + } + + if( $(window).width() > 1000){ $('.login-modal').on("click", function(){ $("#modal-login").toggleClass("show-login"); @@ -160,6 +194,11 @@ jQuery(document).ready(function($){ let course_cards = $('.cmvl-courses-list-shortcode').find('tbody').children('tr'); course_cards.each(function(){ let link = $(this).find('a').attr('href'); + + // remove the get started card from the course list + if($(this).find('a').text() === 'Get Started'){ + $(this).remove(); + } $(this).append( $('', { "class": "view-course-icon", "src": icon_url @@ -182,7 +221,12 @@ jQuery(document).ready(function($){ login_section.on("click", function(){ $("#modal-login").toggleClass("show-login"); }) - + $('.cmdur-success').find('a').on("click", function(e){ + e.preventDefault(); + return false; + }) + $('.cmdur-success').children('a').addClass("login-modal"); + // getting_started.append( $('
',{ // class: 'contact-form', // text: `Invite Superior Hospitality Partners to your community to see if Hospitality Mentality 360 will be beneficial for you and your visitors.`