davicotico / Menu-Editor

Vanilla Javascript Menu Editor (made with Typescript)
https://davidticona.com/demos/javascript-menu-editor/
MIT License
18 stars 5 forks source link

Migration #1

Open ThemeMetro opened 11 months ago

ThemeMetro commented 11 months ago

Hello,

Its possible to migrate from jQuery Menu Editor 1.1.1? If yes then How?

davicotico commented 11 months ago

Hi @ThemeMetro. Yes, it is posible. In order to migrate, you must take into account the following points. This way, you will be able to make the necessary adaptations and replacements.

The data

The data are very similar. You need to change the attribute "title" for "tooltip"

{ 
"href":"http://home.com", // href
"icon":"fas fa-home", // icon
"text":"Home",  // text
"target": "_top",  // target (now this is optional)
"title": "My Home", // tooltip,  <=== Attribute name in Javascript Menu Editor 
"children": [] // children
}

Equivalents methods

jQuery Menu Editor Javascript Menu Editor
setData(data) setArray(data)
getString() getString()

Javascript Menu Editor is not linked to a form or input element, instead is more flexible and have these events and methods:

External plugin

The jQuery plugin "Bootstrap Icon Picker" is no longer necessary. You can choose your own icon picker; however, my new library, Vanilla Javascript Iconpicker, is currently in development stage and I will release it in the upcoming days.

I hope this has helped you. Feel free to reach out to me via Twitter