Skip to content

Commit

Permalink
chore: release 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wuda-io committed Jun 13, 2024
1 parent 90acdf6 commit 62192a3
Show file tree
Hide file tree
Showing 7 changed files with 669 additions and 575 deletions.
1,204 changes: 644 additions & 560 deletions dist/css/materialize.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/css/materialize.min.css

Large diffs are not rendered by default.

26 changes: 18 additions & 8 deletions dist/js/materialize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Materialize v2.0.4 (https://materializeweb.com)
* Materialize v2.1.0 (https://materializeweb.com)
* Copyright 2014-2024 Materialize
* MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)
*/
Expand Down Expand Up @@ -3711,7 +3711,12 @@ class Modal extends component_1.Component {
this.options.onOpenStart.call(this, this.el, this._openingTrigger);
}
if (this.options.preventScrolling) {
document.body.style.overflow = 'hidden';
const hasVerticalScrollBar = document.documentElement.scrollHeight > document.documentElement.clientHeight;
if (hasVerticalScrollBar) {
const scrollTop = document.documentElement.scrollTop;
document.documentElement.style.top = '-' + scrollTop + "px";
document.documentElement.classList.add('noscroll');
}
}
this.el.classList.add('open');
this.el.insertAdjacentElement('afterend', this._overlay);
Expand Down Expand Up @@ -3740,7 +3745,10 @@ class Modal extends component_1.Component {
this.el.classList.remove('open');
// Enable body scrolling only if there are no more modals open.
if (Modal._modalsOpen === 0) {
document.body.style.overflow = '';
const scrollTop = -parseInt(document.documentElement.style.top);
document.documentElement.style.removeProperty("top");
document.documentElement.classList.remove('noscroll');
document.documentElement.scrollTop = scrollTop;
}
if (this.options.dismissible) {
document.removeEventListener('keydown', this._handleKeydown);
Expand Down Expand Up @@ -4670,11 +4678,9 @@ class FormSelect extends component_1.Component {
// Makes new element to assume HTML's select label and aria-attributes, if exists
/*
if (this.el.hasAttribute("aria-labelledby")){
console.log(1);
this.labelEl = <HTMLLabelElement>document.getElementById(this.el.getAttribute("aria-labelledby"));
}
else if (this.el.id != ""){
console.log(2);
const label = document.createElement('label');
label.setAttribute('for', this.el.id);
if (label){
Expand Down Expand Up @@ -6884,9 +6890,13 @@ class Toast {
}
}
_createToast() {
const toast = this.options.toastId
let toast = this.options.toastId
? document.getElementById(this.options.toastId)
: document.createElement('div');
if (toast instanceof HTMLTemplateElement) {
const node = toast.content.cloneNode(true);
toast = node.firstElementChild;
}
toast.classList.add('toast');
toast.setAttribute('role', 'alert');
toast.setAttribute('aria-live', 'assertive');
Expand Down Expand Up @@ -6957,7 +6967,7 @@ class Toast {
this.options.completeCallback();
}
// Remove toast from DOM
if (!this.options.toastId) {
if (this.el.id != this.options.toastId) {
this.el.remove();
Toast._toasts.splice(Toast._toasts.indexOf(this), 1);
if (Toast._toasts.length === 0) {
Expand Down Expand Up @@ -7658,7 +7668,7 @@ class M {
}
}
exports.M = M;
M.version = '2.0.4';
M.version = '2.1.0';
M.Autocomplete = autocomplete_1.Autocomplete;
M.Tabs = tabs_1.Tabs;
M.Carousel = carousel_1.Carousel;
Expand Down
4 changes: 2 additions & 2 deletions dist/js/materialize.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/materialize.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The responsive front-end library based on Material Design from Google.",
"author": "The Materialize Team",
"homepage": "https://materializeweb.com",
"version": "2.0.4",
"version": "2.1.0",
"main": "dist/js/materialize.js",
"style": "dist/css/materialize.css",
"sass": "sass/materialize.scss",
Expand Down
2 changes: 1 addition & 1 deletion src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Range } from './range';
import { Utils } from './utils';

export class M {
static version = '2.0.4';
static version = '2.1.0';

static Autocomplete: typeof Autocomplete = Autocomplete;
static Tabs: typeof Tabs = Tabs;
Expand Down

0 comments on commit 62192a3

Please sign in to comment.