Skip to content

v0.13.29

Compare
Choose a tag to compare
@mechanicious mechanicious released this 05 Sep 10:38
· 44 commits to master since this release

##Quick Overiew

Demo


doMenu v0.13.29


Quick API Reference


Access the public plugin (pPlugin) API with $('#your-domenu-instance').domenu()

array getLists([params])
string parseJson(string data[, bool override = false])
string toJson()
pPlugin expandAll()
pPlugin collapseAll()
pPlugin expand([function callback([item])])
pPlugin collapse([function callback([item])])
array getListNodes()
pPlugin onParseJson(callback)
pPlugin onToJson(callback)
pPlugin onSaveEditBoxInput(callback)
pPlugin onItemDrag(callback)
pPlugin onItemDrop(callback)
pPlugin onItemAdded(callback)
pPlugin onItemRemoved(callback)
pPlugin onItemStartEdit(callback)
pPlugin onItemEndEdit(callback)
object getPluginOptions()

Options


listNodeName:           'ol',
itemNodeName:           'li',
rootClass:              'dd',
listClass:              'dd-list',
itemClass:              'dd-item',
itemBlueprintClass:     'dd-item-blueprint',
dragClass:              'dd-dragel',
handleClass:            'dd-handle',
collapsedClass:         'dd-collapsed',
placeClass:             'dd-placeholder',
noDragClass:            'dd-nodrag',
emptyClass:             'dd-empty',
contentClass:           'dd3-content',
removeBtnClass:         'item-remove',
addBtnClass:            'dd-new-item',
editBoxClass:           'dd-edit-box',
inputSelector:          'input, select, textarea',
expandBtnHTML:          '<button data-action="expand"   type="button">+</button>',
collapseBtnHTML:        '<button data-action="collapse" type="button">-</button>',
editBtnHTML:            '<button data-action="edit"     type="button">edit</button>',
data:                   '',
slideAnimationDuration: 0,
group:                  0,
maxDepth:               20,
threshold:              20,
onToJson:               [],
onParseJson:            [],
onDomenuInitialized:    [],
onSaveEditBoxInput:     [],
onItemDrag:             [],
onItemDrop:             [],
onItemAdded:            [],
onItemExpand:           [],
onItemCollapse:         [],
onItemRemoved:          [],
onItemStartEdit:        [],
onItemEndEdit:          []

Tokens (beta) request a token


Use tokens inside of your data-placeholder and data-default-value attributes of your input. E.g.

 <input type="text" name="title" placeholder="Item" data-placeholder="Item {?numeric.increment}" data-default-value="Item {?numeric.increment}">

  • {?date.gregorian-slashed-DMY} current date in gregorian DMY format
  • {?date.mysql-datetime} valid MySQL datetime format
  • {?numeric.increment} increments itself and outputs a number
  • {?value} current value of the input

Attributes


  • data-placeholder works like the placeholder attribute but has a higher priority and supports Tokens
  • data-default-value the value of this attribute will be use by toJson as a default value when no use supplied value is present

New Features in v0.13.29


  • Dynamic inputs – you can add your own input select and textarea fields of any kind; doMenu will handle them all
  • Tokens and new supported attributes for data-placeholder and data-default-value
  • Lazy event bindings – higher performance
  • Lots of new event listeners and few new options as well as few new methods e.g. getPluginOptions
  • Source code improvements for developers

for more technical information see the dev branch...

Migrating from v0.0.1 to v0.13.19


Just replace your old plugin files with v0.13.29 plugin files; and enjoy the new features!

License & Credits


Copyright © 2015 Mateusz Zawartka | BSD & MIT license

Built upon Nestable from David Bushell