disenable

    1.0.5 • Public • Published

    disenable

    A jQuery plugin serving the purpose of disenabling form controls.

    This plugin will add or reference an element that controls disabled state of any supported form control.

    Supported form controls:

    <button>, <input>, <textarea>, <select>, <fieldset>, <option>, <optgroup>.

    Install

    npm install disenable

    Examples

    Check out: https://hallojoe.github.io/disenable/ or example included in the package.

    Run

    Run npm start or npm install && npm build to get things installed. Now run grunt to build disenable and launch example page.

    Settings

    Property Description

    disabledCss

    Type: String
    Default: "disenable__disabled"

    Css class name that will be added to element or target+trigger when disabled.

    enabledCss

    Type: String
    Default: "disenable__enabled"

    Css class name that will be added to element or target+trigger when enabled.

    triggerElement

    Type: jQuery, String
    Default: "<a href='#' style='text-decoration:none;'></a>"

    The element that will trigger disenableing. Ex: $('some-selector'), ".just-selector", "<a />".

    triggerPlacement

    Type: String
    Default: "before"

    Placement of trigger element disenableing target. Ex. "before" or "after". If value is anything but "before" or "after" then trigger element will not be added by disenable (event will fire on trigger element click).

    triggerToggleHtml

    Type: Boolean
    Default: true

    Should html inside trigger toggle on click.

    triggerDisabledHtml

    Type: String
    Default: "🔒"

    Html that will be injected in trigger element when disabled. ex: "&#128274;", "X", <span class='glyphicon glyphicon-eye-close' />

    triggerEnabledHtml

    Type: String
    Default: "🔓"

    Html that will be injected in trigger element when enabled. ex: "&#128275;", "O", <span class='glyphicon glyphicon-eye-open' />

    Install

    npm i disenable

    DownloadsWeekly Downloads

    8

    Version

    1.0.5

    License

    MIT

    Last publish

    Collaborators

    • avatar