Skip to content

Commit

Permalink
codestyle changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Heusschen committed Mar 21, 2019
1 parent 6c574c4 commit 6113d3b
Show file tree
Hide file tree
Showing 97 changed files with 637 additions and 758 deletions.
2 changes: 1 addition & 1 deletion dist/addons/autoheight/_options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const opts = {
height: 'default' // 'default/highest/auto'
height: 'default'
};
export default opts;
1 change: 0 additions & 1 deletion dist/addons/counters/_options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** Options for the counters add-on. */
const options = {
add: false,
addTo: 'panels',
Expand Down
1 change: 0 additions & 1 deletion dist/addons/dividers/_options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const options = {
add: false,
addTo: 'panels',
fixed: false,
type: null
};
export default options;
2 changes: 1 addition & 1 deletion dist/addons/dividers/mmenu.dividers.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 1 addition & 50 deletions dist/addons/dividers/mmenu.dividers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export default function () {
// Extend shorthand options
if (typeof options == 'boolean') {
options = {
add: options,
fixed: options
add: options
};
}
if (typeof options != 'object') {
Expand Down Expand Up @@ -51,53 +50,5 @@ export default function () {
});
});
}
// Fixed dividers
if (options.fixed) {
// Add the fixed divider.
this.bind('initPanels:after', (panels) => {
if (!this.node.fixeddivider) {
let listview = Mmenu.DOM.create('ul.mm-listview.mm-listview_fixeddivider'), listitem = Mmenu.DOM.create('li.mm-listitem.mm-listitem_divider');
listview.append(listitem);
this.node.pnls.append(listview);
this.node.fixeddivider = listitem;
}
});
// Set the text for the fixed divider.
const setValue = () => {
if (this.opts.offCanvas && !this.vars.opened) {
return;
}
var panel = Mmenu.DOM.children(this.node.pnls, '.mm-panel_opened')[0];
if (!panel || panel.matches('.mm-hidden')) {
return;
}
var scrl = panel.scrollTop, text = '';
Mmenu.DOM.find(panel, '.mm-listitem_divider')
.forEach((divider) => {
if (!divider.matches('.mm-hidden')) {
if (divider.offsetTop + scrl < scrl + 1) {
text = divider.innerHTML;
}
}
});
this.node.fixeddivider.innerHTML = text;
this.node.pnls.classList[text.length ? 'add' : 'remove']('mm-panels_dividers');
};
// Set correct value when
// 1) opening the menu,
// 2) opening a panel,
// 3) after updating listviews and
// 4) after scrolling a panel
this.bind('open:start', setValue); // 1
this.bind('openPanel:start', setValue); // 2
this.bind('updateListview', setValue); // 3
this.bind('initPanel:after', (panel) => {
panel.addEventListener('scroll', () => {
if (panel.matches('.mm-panel_opened')) {
setValue.call(this, panel);
}
}, { passive: true });
});
}
}
;
2 changes: 1 addition & 1 deletion dist/addons/iconbar/mmenu.iconbar.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/addons/iconpanels/mmenu.iconpanels.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/addons/navbars/mmenu.navbars.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/addons/sectionindexer/mmenu.sectionindexer.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/addons/sectionindexer/mmenu.sectionindexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function () {
});
let indexer = Mmenu.DOM.create('div.mm-sectionindexer');
indexer.innerHTML = buttons;
this.node.menu.prepend(indexer);
this.node.pnls.prepend(indexer);
this.node.indx = indexer;
// Prevent default behavior when clicking an anchor
this.node.indx.addEventListener('click', (evnt) => {
Expand Down
Loading

0 comments on commit 6113d3b

Please sign in to comment.