scinote-web/app/javascript/packs/application.js

26 lines
766 B
JavaScript
Raw Normal View History

window.bwipjs = require('bwip-js');
window.Decimal = require('decimal.js');
$(document).on('click', '.sci--layout--menu-item[data-submenu=true]', (e) => {
const item = $(e.currentTarget);
const caret = item.find('.show-submenu');
const submenu = item.next();
e.preventDefault();
if (submenu.attr('data-collapsed') === 'true') {
2023-06-08 23:33:50 +08:00
caret.removeClass('sn-icon-right').addClass('sn-icon-down');
submenu.attr('data-collapsed', false);
} else {
2023-06-08 23:33:50 +08:00
caret.removeClass('sn-icon-down').addClass('sn-icon-right');
submenu.attr('data-collapsed', true);
}
});
$(document).on('click', '.sci--layout--navigator-open', (e) => {
navigatorContainer.$data.navigatorCollapsed = false
});
2023-06-19 21:45:22 +08:00
$(document).on('click', '.btn', function() {
$(this).blur();
});