Skip to content

jwalsh/jquery-enableable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Summary

Allow a UI component (in particular form elements) to be marked as something that could be enabled with explict user interaction. Decouple the feature status from the page markup.

http://www.urbandictionary.com/define.php?term=enableable

Examples

JavaScript

$('.enab1').enableable();
$('.select1').enableable({enabled: true});
$('textarea #my-enable-ta')
  .css('border', '1px solid #888')
  .enableable(
    {
      locked: true,
      display: 'opaque',
      hint: 'Use widget',
      debug: true
    });

HTML

<div class="jq-enableable">
  <h1>.jq-enable</h1>
  <form>
    <input type="text" name="text1"/>
    <div class="enab1" data-enableable="Edit now...">
      <h2>.enab1</h2>
      <select name="select1">
        <option/>
        <option>option1</option>
        <option>option2</option>
      </select>
      <div id="my-enable">
        <h3>#my-enable</h3>
        <textarea id="my-enable-ta">
        </textarea>
      </div>
    </div>
  </form>
</div>

Configuration

  • locked: false
  • enabled: false
  • autorun: true
  • display: disabled (disabled, hidden, opaque)
  • debug: false
  • hint: “Enable” > @data-enableable
  • enable-if-populated: TBD
  • clear-when-disabled | reset-on-disable

Tasks

Design notes and examples

Should be sufficiently small that dependency management isn’t required.

Depends on jQuery since it requires UI component selection.

No templating since the UI components are so small.

No validation since this is a wrapper.

Build through grunt.

No JSDoc processing initially (given configuration pattern).

Nomenclature

Research notes

https://speakerdeck.com/addyosmani/building-decoupled-large-scale-applications-using-javascript-and-jquery

Wrapping classes

jQuery

Options

Research

See related enable and disable widget notes in http://en.wikipedia.org/wiki/GUI_widget .

Frameworks

Plugins

Searched through the plugins directory to find something similar.

Name

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published