PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.3.3
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.3.3
2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 All 67 releases
better-payment / assets / js / elementor / edit / better-payment-select2.js

better-payment-select2.js in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 2.3.3, at assets/js/elementor/edit/better-payment-select2.js

32 lines 4.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3 * This devtool is neither made for production nor for readable output files.
4 * It uses "eval()" calls to create a separate source file in the browser devtools.
5 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6 * or disable the default devtool with "devtool: false".
7 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8 */
9 /******/ (() => { // webpackBootstrap
10 /******/ var __webpack_modules__ = ({
11
12 /***/ "./src/js/elementor/edit/better-payment-select2.js"
13 /*!*********************************************************!*\
14 !*** ./src/js/elementor/edit/better-payment-select2.js ***!
15 \*********************************************************/
16 () {
17
18 eval("{;\n(function ($) {\n $(document).on('better_payment_select2_init', function (event, obj) {\n var ID = '#elementor-control-default-' + obj.data._cid;\n setTimeout(function () {\n var IDSelect2 = $(ID).select2({\n minimumInputLength: 3,\n placeholder: obj.data.placeholder || better_payment_select2_localize.search_text,\n allowClear: true,\n ajax: {\n url: better_payment_select2_localize.ajaxurl + \"?action=better_payment_select2_search_post&post_type=\" + obj.data.source_type + '&source_name=' + obj.data.source_name,\n dataType: 'json'\n },\n initSelection: function (element, callback) {\n if (!obj.multiple) {\n callback({\n id: '',\n text: obj.data.placeholder || better_payment_select2_localize.search_text\n });\n } else {\n callback({\n id: '',\n text: ''\n });\n }\n var ids = [];\n if (!Array.isArray(obj.currentID) && obj.currentID != '') {\n ids = [obj.currentID];\n } else if (Array.isArray(obj.currentID)) {\n ids = obj.currentID.filter(function (el) {\n return el != null;\n });\n }\n if (ids.length > 0) {\n var label = $(\"label[for='elementor-control-default-\" + obj.data._cid + \"']\");\n label.after('<span class=\"elementor-control-spinner\">&nbsp;<i class=\"eicon-spinner eicon-animation-spin\"></i>&nbsp;</span>');\n $.ajax({\n method: \"POST\",\n url: better_payment_select2_localize.ajaxurl + \"?action=better_payment_select2_get_title\",\n data: {\n post_type: obj.data.source_type,\n source_name: obj.data.source_name,\n id: ids\n }\n }).done(function (response) {\n if (response.success && typeof response.data.results != 'undefined') {\n let eaelSelect2Options = '';\n ids.forEach(function (item, index) {\n if (typeof response.data.results[item] != 'undefined') {\n const key = item;\n const value = response.data.results[item];\n eaelSelect2Options += `<option selected=\"selected\" value=\"${key}\">${value}</option>`;\n }\n });\n element.append(eaelSelect2Options);\n }\n label.siblings('.elementor-control-spinner').remove();\n });\n }\n }\n });\n\n //Manual Sorting : Select2 drag and drop : starts\n // #ToDo Try to use promise in future\n setTimeout(function () {\n IDSelect2.next().children().children().children().sortable({\n containment: 'parent',\n stop: function (event, ui) {\n ui.item.parent().children('[title]').each(function () {\n var title = $(this).attr('title');\n var original = $('option:contains(' + title + ')', IDSelect2).first();\n original.detach();\n IDSelect2.append(original);\n });\n IDSelect2.change();\n }\n });\n $(ID).on(\"select2:select\", function (evt) {\n var element = evt.params.data.element;\n var $element = $(element);\n $element.detach();\n $(this).append($element);\n $(this).trigger(\"change\");\n });\n }, 200);\n //Manual Sorting : Select2 drag and drop : ends\n }, 100);\n });\n})(jQuery);\n\n//# sourceURL=webpack://better-payment/./src/js/elementor/edit/better-payment-select2.js?\n}");
19
20 /***/ }
21
22 /******/ });
23 /************************************************************************/
24 /******/
25 /******/ // startup
26 /******/ // Load entry module and return exports
27 /******/ // This entry module can't be inlined because the eval devtool is used.
28 /******/ var __webpack_exports__ = {};
29 /******/ __webpack_modules__["./src/js/elementor/edit/better-payment-select2.js"]();
30 /******/
31 /******/ })()
32 ;