mmenu-js
Version:
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
31 lines (30 loc) • 764 B
JavaScript
var options = [];
export default options;
/**
* Extend shorthand options.
*
* @param {object} options The options to extend.
* @return {object} The extended options.
*/
export function extendShorthandOptions(options) {
if (typeof options == 'boolean' && options) {
options = {};
}
if (typeof options != 'object') {
options = {};
}
if (typeof options.content == 'undefined') {
options.content = ['prev', 'title'];
}
if (!(options.content instanceof Array)) {
options.content = [options.content];
}
if (typeof options.use == 'undefined') {
options.use = true;
}
if (typeof options.use == 'boolean' && options.use) {
options.use = true;
}
return options;
}
;