D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u193541357
/
domains
/
racysanitaryware.com
/
public_html
/
dev
/
admin
/
js
/
Filename :
script.js
back
Copy
(function ($) { "use strict"; // Start of use strict // Toggle the side navigation $("#sidebarToggle, #sidebarToggleTop").on('click', function (e) { $("body").toggleClass("sidebar-toggled"); $(".sidebar").toggleClass("toggled"); if ($(".sidebar").hasClass("toggled")) { $('.sidebar .collapse').collapse('hide'); }; }); // Close any open menu accordions when window is resized below 768px $(window).resize(function () { if ($(window).width() < 768) { $('.sidebar .collapse').collapse('hide'); }; // Toggle the side navigation when window is resized below 480px if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) { $("body").addClass("sidebar-toggled"); $(".sidebar").addClass("toggled"); $('.sidebar .collapse').collapse('hide'); }; }); // Prevent the content wrapper from scrolling when the fixed side navigation hovered over $('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function (e) { if ($(window).width() > 768) { var e0 = e.originalEvent, delta = e0.wheelDelta || -e0.detail; this.scrollTop += (delta < 0 ? 1 : -1) * 30; e.preventDefault(); } }); // Scroll to top button appear $(document).on('scroll', function () { var scrollDistance = $(this).scrollTop(); if (scrollDistance > 100) { $('.scroll-to-top').fadeIn(); } else { $('.scroll-to-top').fadeOut(); } }); // Smooth scrolling using jQuery easing $(document).on('click', 'a.scroll-to-top', function (e) { var $anchor = $(this); $('html, body').stop().animate({ scrollTop: ($($anchor.attr('href')).offset().top) }, 1000, 'easeInOutExpo'); e.preventDefault(); }); $(document).on('change', '.status-toggle-categories', function () { var id = $(this).data('id'); var status = this.checked ? 1 : 0; // AJAX request to update the status $.ajax({ url: 'https://dev.racysanitaryware.com/admin/update-category-status.php', // PHP file to handle the update type: 'POST', data: { id: id, status: status }, success: function (response) { if (response == 'success') { alert('Category updated successfully!'); } else { alert('Error updating in Category status.'); } } }); }); // $(document).on('change', '.status-toggle-product', function () { // var id = $(this).data('id'); // var status = this.checked ? 1 : 0; // // AJAX request to update the status // $.ajax({ // url: 'update-product-status.php', // PHP file to handle the update // type: 'POST', // data: { // id: id, // status: status // }, // success: function (response) { // if (response == 'success') { // alert('Product Status Changed successfully!'); // } else { // alert('Error in Updating Status in Products.'); // } // } // }); // }); // $(document).on('change', '.status-toggle-team', function () { // var id = $(this).data('id'); // var status = this.checked ? 1 : 0; // // AJAX request to update the status // $.ajax({ // url: 'update-team-status.php', // PHP file to handle the update // type: 'POST', // data: { // id: id, // status: status // }, // success: function (response) { // if (response == 'success') { // alert('Team Member Status updated successfully!'); // } else { // alert('Error updating in Team Member Status Change.'); // } // } // }); // }); $(document).on('change', '.status-toggle-products', function () { var id = $(this).data('id'); var status = this.checked ? 1 : 0; // AJAX request to update the status $.ajax({ url: 'https://dev.racysanitaryware.com/admin/update-product-status.php', // PHP file to handle the update type: 'POST', data: { id: id, status: status }, success: function (response) { if (response == 'success') { alert('Project Status Updated successfully!'); } else { alert('Error updating in Project Status Change.'); } } }); }); $('.project_index').on('change', function () { var index_value = $(this).val(); // Get the input value var project_id = $(this).data('id'); // Get the project ID // Make sure the input is valid (between 1 and 3) if (index_value < 1 || index_value > 100) { alert("Index number must be between 1 and 100."); $(this).val(''); // Clear the input return; } // Make AJAX call to update project_index in the database // $.ajax({ // url: 'update_project_index.php', // type: 'POST', // data: { // index_value: index_value, // project_id: project_id // }, // success: function (response) { // if (response.status == 'success') { // alert("Project index updated successfully."); // } else { // alert("Error: " + response.message); // } // }, // error: function () { // alert("An error occurred while updating the project index."); // } // }); }); tinymce.init({ selector: 'textarea#blogDescription' }); })(jQuery);