inp
inplace
npm i inplace
inp

inplace

✏️ Inplace - An inplace editor

by Washington Botelho

0.1.1 (see all)License:MITTypeScript:Not Found
npm i inplace
Readme

Inplace - An inplace editor

Build Status NPM Version Dependency Dev Dependency Code Climate Support

Inplace is an tiny inplace editor to enable a quick ajax update with no need to create a form.

Options

`data-field-name`: Name of the field;
`data-field-text`: Name of the attribute of the returned JSON used to be the inplace text;
`data-field-value`: Value of the field;
`data-field-type`: Field type that can be `text` or `select`;
`data-options`: Data options setted on the field with prefix `inplace-`;
`data-url`: URL used to post the data;

Usage

You declare an element with optional data atributes:

<div
  class="inplace"
  data-attributes='{ "maxlength": 2 }'
  data-field-name="number"
  data-field-value="42"
  data-url="/update"
>42</div>

On JS you can declare attributes too, but data attributes has priority:

$('.inplace').inplace({ url: '/save' });

Downloads/wk

11

GitHub Stars

11

LAST COMMIT

5mos ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

3

OPEN PRs

0
VersionTagPublished
0.1.1
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate