mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
More jQuery to native (including bootstrap.js)
This commit is contained in:
parent
bdb36ec128
commit
69fcc240e9
39 changed files with 496 additions and 344 deletions
13
dev/prototype-element.js
vendored
Normal file
13
dev/prototype-element.js
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
(()=>{
|
||||
Element.prototype.closestWithin = function(selector, parent) {
|
||||
const el = this.closest(selector);
|
||||
return (el && el !== parent && parent.contains(el)) ? el : null;
|
||||
};
|
||||
|
||||
Element.fromHTML = string => {
|
||||
const template = document.createElement('template');
|
||||
template.innerHTML = string.trim();
|
||||
return template.content.firstChild;
|
||||
};
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue