芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/jet-tabs/assets/js/jet-tabs-editor.js
(function( $ ) { 'use strict'; var JetTabsEditor, JetTabsData = window.JetTabsData || {}; JetTabsEditor = { modal: false, init: function() { window.elementor.on( 'preview:loaded', JetTabsEditor.onPreviewLoaded ); }, onPreviewLoaded: function() { var $previewContents = window.elementor.$previewContents, elementorFrontend = $('#elementor-preview-iframe')[0].contentWindow.elementorFrontend; elementorFrontend.hooks.addAction( 'frontend/element_ready/jet-tabs.default', function( $scope ){ $scope.find( '.jet-tabs__edit-cover' ).on( 'click', JetTabsEditor.showTemplatesModal ); $scope.find( '.jet-tabs-new-template-link' ).on( 'click', function( event ) { window.location.href = $( this ).attr( 'href' ); } ); } ); elementorFrontend.hooks.addAction( 'frontend/element_ready/jet-accordion.default', function( $scope ){ $scope.find( '.jet-toggle__edit-cover' ).on( 'click', JetTabsEditor.showTemplatesModal ); $scope.find( '.jet-toogle-new-template-link' ).on( 'click', function( event ) { window.location.href = $( this ).attr( 'href' ); } ); } ); elementorFrontend.hooks.addAction( 'frontend/element_ready/jet-switcher.default', function( $scope ){ $scope.find( '.jet-switcher__edit-cover' ).on( 'click', JetTabsEditor.showTemplatesModal ); $scope.find( '.jet-switcher-new-template-link' ).on( 'click', function( event ) { window.location.href = $( this ).attr( 'href' ); } ); } ); JetTabsEditor.getModal().on( 'hide', function() { window.elementor.reloadPreview(); }); }, showTemplatesModal: function() { var editLink = $( this ).data( 'template-edit-link' ); JetTabsEditor.showModal( editLink ); }, showModal: function( link ) { var $iframe, $loader; JetTabsEditor.getModal().show(); $( '#jet-tabs-template-edit-modal .dialog-message').html( '
' ); $( '#jet-tabs-template-edit-modal .dialog-message').append( '
Loading
' ); $iframe = $( '#jet-tabs-edit-frame'); $loader = $( '#jet-tabs-loading'); $iframe.on( 'load', function() { $loader.fadeOut( 300 ); } ); }, getModal: function() { if ( ! JetTabsEditor.modal ) { this.modal = elementor.dialogsManager.createWidget( 'lightbox', { id: 'jet-tabs-template-edit-modal', closeButton: true, closeButtonClass: 'eicon-close', hide: { onBackgroundClick: false } } ); } return JetTabsEditor.modal; } }; $( window ).on( 'elementor:init', JetTabsEditor.init ); })( jQuery );