editable-placeholder-component

0.0.2 • Public • Published

Editable-Placeholder

ContentEditable placeholder for use with nickjackson/editable

Introduction

This component is a plugin to use with nickjackson/editable.

Installation

$ component install nickjackson/editable

Example

var Editable = require('editable')
  , Placeholder = require('editable-placeholder')
  , el = document.querySelector('h1')
  , display = true
  , ph = Placeholder('placeholder text here', display);
 
Editable(el).use(ph);

API

Placeholder(text, display);

  • text - string you wish to be displayed in the placeholder
  • display - display text on initalize (boolean)

Returns a wrapper function with the main argument requring an instance of Editable.

Todo

  • Test on other browsers. Currently only tested on Chrome OSX.

License

MIT

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i editable-placeholder-component

    Weekly Downloads

    2

    Version

    0.0.2

    License

    none

    Last publish

    Collaborators

    • nickjackson