Backend for songs.zachdecook.com
Diffstat (limited to 'laravel/public/js/jsonly.js')
-rw-r--r--laravel/public/js/jsonly.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/laravel/public/js/jsonly.js b/laravel/public/js/jsonly.js
index ae1ceb1..4f5d6c8 100644
--- a/laravel/public/js/jsonly.js
+++ b/laravel/public/js/jsonly.js
@@ -42,20 +42,18 @@ function do_transpose()
$(this).removeClass("chord"+old);
$(this).addClass("chord"+neww);
});
- $(".btn[data-key]").each(function(){
+ $(".but[data-key]").each(function(){
console.log($(this));
var oldKey = $(this).attr('data-key');
var newKey = transpadd(oldKey, transp - lastTransp);
if ( typeof newKey !== 'undefined' )
{
- $(this).removeClass('btn-'+oldKey);
- $(this).addClass('btn-'+newKey);
+ //$(this).removeClass('btn-'+oldKey);
+ //$(this).addClass('btn-'+newKey);
$(this).attr('data-key', newKey);
$(this).text( $(this).attr('data-words') + newKey );
}
- var tt = parseInt($(this).attr('href').match(/transp=(.+)/)[1]);
- tt = ( transp - lastTransp + 24 + tt)%12;
- var newhref = $(this).attr('href').match(/(.*?&transp=).+/)[1] + tt;
+ var newhref = $(this).attr('href').match(/(.*?key=).+/)[1] + newKey;
$(this).attr('href', newhref);
})
lastTransp = transp;