burak277 / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

clash with jquery.formatCurrency-1.0.0.min.js #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use jquery.formatCurrency-1.0.0.min.js"
2. Add hotkeys to the page (no calls to it
3. formatCurrency() no longer works.

What is the expected output? What do you see instead?
I expect to see my formatCurrency code still working

What version of the product are you using? On what operating system?
jquery.hotkeys-0.7.9.min.js, Linux, FF with Firebug

Please provide any additional information below.
There are no errors, just the previous working code working no longer...

Original issue reported on code.google.com by skylar.s...@gmail.com on 27 Aug 2009 at 7:17

GoogleCodeExporter commented 9 years ago
Actually, for some reason, 
<script src="{{ STATIC_URL }}js/jquery.hotkeys-0.7.9.min.js"
type="text/javascript"></script>
on the page, before or after the following script disables the script without 
error
even without formatcurrency on the page:

<script>
    $(function(){
        /*
        $(document).bind('keydown', 'ctrl+a', function(){
            $('input#change_hundreds').focus();
        });
        */
        $('div#drawer').load('{% url drawer_detail drawer.id %}'+ ' #drawer-detail',
null, function(){
            $('input#change-transaction').hide();
            $('div#drawer-detail input').live('keyup', function() {

                var changeHun = $('input#change_hundreds').val()*1;
                if (isNaN(changeHun)){ changeHun = 0;}

                var changeFif = $('input#change_fifties').val()*1;
                if (isNaN(changeFif)){ changeFif = 0;}

                var changeTwe = $('input#change_twenties').val()*1;
                if (isNaN(changeTwe)) changeTwe = 0;

                var changeTen = $('input#change_tens').val()*1;
                if (isNaN(changeTen)) changeTen = 0;

                var changeFiv = $('input#change_fives').val()*1;
                if (isNaN(changeFiv)) changeFiv = 0;

                var changeOne = $('input#change_ones').val()*1;
                if (isNaN(changeOne)) changeOne = 0;

                var changeDol = $('input#change_dollar').val()*1;
                if (isNaN(changeDol)) changeDol = 0;

                var changeHal = $('input#change_half').val()*1;
                if (isNaN(changeHal)) changeHal = 0;

                var changeQua = $('input#change_quarter').val()*1;
                if (isNaN(changeQua)) changeQua = 0;

                var changeDim = $('input#change_dime').val()*1;
                if (isNaN(changeDim)) changeDim = 0;

                var changeNic = $('input#change_nickel').val()*1;
                if (isNaN(changeNic)) changeNic = 0;

                var changePen = $('input#change_penny').val()*1;
                if (isNaN(changePen)) changePen = 0;

                var balance = changeHun*100+
                              changeFif*50+
                              changeTwe*20+
                              changeTen*10+
                              changeFiv*5+
                              changeOne*1+
                              changeDol*1+
                              changeHal*.5+
                              changeQua*.25+
                              changeDim*.10+
                              changeNic*.05+
                              changePen*.01;
                //console.log(balance);                
                $('td#total_input').html(balance);
                //.formatCurrency(
                //    { colorize:true, }
                //);
                if (balance==""*0){
                    $('input#change-transaction').show();
                }else{
                    $('input#change-transaction').hide();
                }
            });
        });
   })
</script>

Original comment by skylar.s...@gmail.com on 28 Aug 2009 at 5:12