| Server IP : 94.177.215.211 / Your IP : 216.73.217.152 Web Server : nginx/1.26.0 System : Linux mtncompany-wp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source,eval MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/sites/morsiesorsi/wp-content/themes/woodmart/inc/admin/assets/js/ |
Upload File : |
/* global woodmartConfig */
(function($) {
'use strict';
document.addEventListener('wdBuilderPopupOpened', (event) => {
htmlBlockEditLink();
});
$('#vc_ui-panel-edit-element').on('vcPanel.shown', function() {
htmlBlockEditLink();
});
$(document).on('menu-item-added', function() {
htmlBlockEditLink();
});
jQuery(window).on('elementor:init', function() {
elementor.hooks.addAction('panel/open_editor/widget', function () {
htmlBlockEditLink();
});
});
function htmlBlockEditLink() {
$('.xts-edit-block-link').each(function() {
var $link = $(this);
var $parent = $link.parent();
if ($link.parents('.whb-editor-field-inner').length) {
$parent = $link.parents('.whb-editor-field-inner');
}
var $select = $parent.find('select');
if (!$select.length) {
$select = $parent.parent().find('select');
}
if ( ! $select.length ) {
return;
}
changeLink();
$select.on( 'change', function() {
changeLink();
});
function changeLink() {
var selectValue = $select.find('option:selected').val();
var currentHref = $link.attr('href');
var newHref = currentHref.split('post=')[0] + 'post=' + selectValue + '&action=';
if ( $('body').hasClass('elementor-editor-active') || 'undefined' !== typeof woodmartConfig && 'elementor' === woodmartConfig.current_page_builder) {
newHref += 'elementor';
} else {
newHref += 'edit';
}
if (!selectValue || '0' === selectValue || 0 === selectValue) {
$link.hide();
$link.siblings('.xts-add-block-link').show();
} else {
$link.attr('href', newHref).show();
$link.siblings('.xts-add-block-link').hide();
}
}
});
}
$(document).ready(function() {
htmlBlockEditLink();
});
})(jQuery);