Skip to content

Instantly share code, notes, and snippets.

@danharper
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danharper/faa9ecfdb925aff4de5c to your computer and use it in GitHub Desktop.
Save danharper/faa9ecfdb925aff4de5c to your computer and use it in GitHub Desktop.
Small wrapper around Ionic's Keyboard plugin for Cordova; works in Browser (https://github.com/driftyco/ionic-plugins-keyboard)
define [], () ->
hasCordova = window.cordova?
class Keyboard
open: ->
if hasCordova
cordova.plugins.Keyboard.show()
else
console.info 'would open Keyboard'
close: ->
if hasCordova
cordova.plugins.Keyboard.close()
else
console.info 'would close Keyboard'
return new Keyboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment