This commit is contained in:
Matteo Manzinello 2019-05-22 09:32:21 +02:00
parent c7e2afb0c0
commit 40d430c065
2 changed files with 4 additions and 5 deletions

7
dist/mailgo.js vendored
View File

@ -1,6 +1,6 @@
"use strict";
var V = "0.4.3";
var V = "0.4.4";
var MAILTO = "mailto:"; // mailgo style
var mailgoCSS = document.createElement("link");
@ -261,7 +261,7 @@ var actions = {
* function to check if an element is mailgo-enabled or not referencing to the old
* document.querySelectorAll(
* 'a[href^="mailto:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
* ); and the new a[mailgo]
* );
*/
var mailgoCheckRender = function mailgoCheckRender(event) {
@ -273,8 +273,7 @@ var mailgoCheckRender = function mailgoCheckRender(event) {
if ( // first case: it is an <a> element with "mailto:..." in href and no no-mailgo in classList
e.href && e.href.toLowerCase().startsWith(MAILTO) && !e.classList.contains("no-mailgo") || // second case: the href=#mailgo
e.href && e.getAttribute("href").toLowerCase() === "#mailgo" || // third case: the classList contains mailgo
e.classList.contains("mailgo") || // fourth case: exists the attribute mailgo in the <a> element
!!e.getAttribute("mailgo")) {
e.classList.contains("mailgo")) {
// stop the normal execution of the element click
event.preventDefault(); // render mailgo

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long