Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.1 KB

README.md

File metadata and controls

45 lines (30 loc) · 1.1 KB

PhoneGap Plugin for Native Menus

HTMLMenuElement and HTMLCommandElement polyfill

Overview

The implementation is loosely based on the W3C HTMLMenuElement / HTMLCommandElement Specification.

API

Markup

Toolbar:

<menu type="toolbar" label="Tweets">
  <command type="command" label="Back"    icon="back-arrow.png" disabled="false" accesskey="back" />
  <command type="command" label="Options" icon="gear.png"       disabled="false" />
</menu>

Context Menu:

<menu type="context">
  <command label="Tweets"  icon="bubble.png"  disabled="false" />
  <command label="Replies" icon="reply.png"   disabled="false" />
  <command label="Search"  icon="search.png"  disabled="false" accesskey="search" />
  <command label="Profile" icon="profile.png" disabled="false" />
</menu>

JavaScript

HTMLMenuElement:

  • appendChild(...)
  • removeChild(...)
  • setAttribute(...);
  • removeAttribute(...)

HTMLCommandElement:

  • setAttribute(...);
  • removeAttribute(...)