mmenu-js
Version:
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
34 lines (33 loc) • 741 B
JavaScript
import { type } from '../../_modules/helpers';
var options = {
use: false,
top: [],
bottom: [],
position: 'left',
type: 'default'
};
export default options;
/**
* Extend shorthand options.
*
* @param {object} options The options to extend.
* @return {object} The extended options.
*/
export function extendShorthandOptions(options) {
if (type(options) == 'array') {
options = {
use: true,
top: options
};
}
if (type(options) != 'object') {
options = {};
}
if (typeof options.use == 'undefined') {
options.use = true;
}
if (typeof options.use == 'boolean' && options.use) {
options.use = true;
}
return options;
}