Search code examples
javascriptcoffeescripthtml5boilerplate

HTML5 Mobile Boilerplate Coffeescript Calls


How can I write these JS calls in Coffeescript?

iPhone Scale Bug Fix

MBP.scaleFix();

Hide URL Bar

MBP.hideUrlBar();

Fast Buttons (only use this if you only target webkit browsers, we are still testing out cross-browser support)

new MBP.fastButton(document.getElementById('myBtn'), function() {alert("clicked")});

Autogrow textarea

new MBP.autogrow(document.getElementById('myTextarea'), 14); // 14 -- line height

https://github.com/h5bp/mobile-boilerplate/wiki/JavaScript-Helper


Solution

  • They mostly stay the same.

    iPhone Scale Bug Fix

    MBP.scaleFix()
    

    Hide URL Bar

    MBP.hideUrlBar()
    

    Fast Buttons

    new MBP.fastButton document.getElementById('myBtn'), -> alert "clicked"
    

    Autogrow textarea

    new MBP.autogrow document.getElementById('myTextarea'), 14