PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | js/plugin-search.js +7 -13 6.26 → trunk View file →
@@ -2,10 +2,8 @@
2 2 * Handles replacing the bottom row
3 3 * of the card with customized content.
4 4 */
5 5
6 -/* global frmPlugSearch */
7 -
8 6 let FormidablePSH = {};
9 7
10 8 function frmPS() {
11 9 FormidablePSH = {
@@ -15,9 +13,9 @@
15 13 * Get parent search hint element.
16 14 *
17 15 * @return {Element|null} The parent search hint element.
18 16 */
19 - getCard: function() {
17 + getCard() {
20 18 return document.querySelector( '.plugin-card-frm-plugin-search' );
21 19 },
22 20
23 21 /**
@@ -22,22 +20,18 @@
22 20
23 21 /**
24 22 * Replace bottom row of the card to insert logo, text and link to dismiss the card.
25 23 */
26 - replaceCardBottom: function() {
24 + replaceCardBottom() {
27 25 const hint = FormidablePSH.getCard();
28 26 if ( 'object' === typeof hint && null !== hint ) {
29 27 hint.querySelector( '.plugin-card-bottom' ).outerHTML =
30 - '<div class="plugin-card-bottom frm-plugin-search__bottom">' +
31 - '<p class="frm-plugin-search__text">' +
32 - frmPlugSearch.legend +
33 - '</p>' +
34 - '</div>';
28 + `<div class="plugin-card-bottom frm-plugin-search__bottom"><p class="frm-plugin-search__text">${ frmPlugSearch.legend }</p></div>`;
35 29
36 30 // Remove link and parent li from action links and move it to bottom row
37 31 const dismissLink = document.querySelector( '.frm-plugin-search__dismiss' );
38 - dismissLink.parentNode.parentNode.removeChild( dismissLink.parentNode );
39 - document.querySelector( '.frm-plugin-search__bottom' ).appendChild( dismissLink );
32 + dismissLink.parentNode.remove();
33 + document.querySelector( '.frm-plugin-search__bottom' ).append( dismissLink );
40 34 }
41 35 },
42 36
43 37 /**
@@ -44,9 +38,9 @@
44 38 * Check if plugin card list nodes changed. If there's a Formidable PSH card, replace the title and the bottom row.
45 39 *
46 40 * @param {Array} mutationsList
47 41 */
48 - replaceOnNewResults: function( mutationsList ) {
42 + replaceOnNewResults( mutationsList ) {
49 43 mutationsList.forEach( function( mutation ) {
50 44 if (
51 45 'childList' === mutation.type &&
52 46 1 === document.querySelectorAll( '.plugin-card-frm-plugin-search' ).length
@@ -58,9 +52,9 @@
58 52
59 53 /**
60 54 * Start suggesting.
61 55 */
62 - init: function() {
56 + init() {
63 57 if ( FormidablePSH.$pluginFilter === null ) {
64 58 return;
65 59 }
66 60