first commit
This commit is contained in:
68
public/wp-content/plugins/rakar-core/assets/js/rakar-core.js
Normal file
68
public/wp-content/plugins/rakar-core/assets/js/rakar-core.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
|
||||
[Main Script]
|
||||
|
||||
Project: Rakar
|
||||
Version: 1.0
|
||||
Author : Themeholy
|
||||
|
||||
*/
|
||||
;(function($){
|
||||
"use strict";
|
||||
|
||||
jQuery(window).on( 'elementor/frontend/init', function() {
|
||||
// console.log( elementorFrontend);
|
||||
if( typeof elementor != "undefined" && typeof elementor.settings.page != "undefined" ) {
|
||||
|
||||
elementor.settings.page.addChangeCallback( 'rakar_header_style', function ( newValue ) {
|
||||
if( newValue == 'prebuilt' ) {
|
||||
elementor.saver.update({
|
||||
onSuccess: function() {
|
||||
elementor.reloadPreview();
|
||||
elementor.once( 'preview:loaded', function() {
|
||||
elementor.getPanelView().setPage( 'page_settings' ).activateTab('settings');
|
||||
} );
|
||||
}
|
||||
});
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
elementor.settings.page.addChangeCallback( 'rakar_header_builder_option', function ( newValue ) {
|
||||
elementor.saver.update({
|
||||
onSuccess: function() {
|
||||
elementor.reloadPreview();
|
||||
elementor.once( 'preview:loaded', function() {
|
||||
elementor.getPanelView().setPage( 'page_settings' ).activateTab('settings');
|
||||
} );
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
elementor.settings.page.addChangeCallback( 'rakar_footer_style', rakarFooterStyle );
|
||||
function rakarFooterStyle ( newValue ) {
|
||||
elementor.saver.update({
|
||||
onSuccess: function() {
|
||||
elementor.reloadPreview();
|
||||
elementor.once( 'preview:loaded', function() {
|
||||
elementor.getPanelView().setPage( 'page_settings' ).activateTab('settings');
|
||||
} );
|
||||
}
|
||||
});
|
||||
}
|
||||
elementor.settings.page.addChangeCallback( 'rakar_footer_choice', rakarFooterChoice );
|
||||
function rakarFooterChoice ( newValue ) {
|
||||
elementor.saver.update({
|
||||
onSuccess: function() {
|
||||
elementor.reloadPreview();
|
||||
elementor.once( 'preview:loaded', function() {
|
||||
elementor.getPanelView().setPage( 'page_settings' ).activateTab('settings');
|
||||
} );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
45
public/wp-content/plugins/rakar-core/assets/js/rakar.ajax.js
Normal file
45
public/wp-content/plugins/rakar-core/assets/js/rakar.ajax.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
|
||||
[Main Script]
|
||||
|
||||
Project: Rakar
|
||||
Version: 1.0
|
||||
Author : Themeholy
|
||||
|
||||
*/
|
||||
;(function($){
|
||||
"use strict";
|
||||
/* ------------------------------------------------------------------------- *
|
||||
|
||||
* Mail Chimp ajax
|
||||
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
var $widgetsubscribeForm = $('form.footer-newsletter');
|
||||
|
||||
// Subscribe Shortcode MailChimp ajax
|
||||
$widgetsubscribeForm.on('submit',function(e){
|
||||
let $emailAdd = $(this).find('input[type="email"]').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: rakarajax.action_url,
|
||||
data:{
|
||||
sectsubscribe_email: $emailAdd,
|
||||
security: rakarajax.nonce,
|
||||
action: 'rakar_subscribe_ajax'
|
||||
},
|
||||
|
||||
success: function(data){
|
||||
$('form.footer-newsletter input[type="email"]').val('');
|
||||
$('.footer-newsletter').append(data);
|
||||
},
|
||||
|
||||
error: function(){
|
||||
$('.footer-newsletter').append('<div class="alert alert-danger mt-2" role="alert">Something Goes Wrong</div>');
|
||||
|
||||
}
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user