Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix dashboard's modals
dominik-zeglenc0cc9f22d246
diff --git a/saleor/static/dashboard/js/dashboard.js b/saleor/static/dashboard/js/dashboard.jsindex db1d05dab4..6cf94eddfb 100644--- a/saleor/static/dashboard/js/dashboard.js+++ b/saleor/static/dashboard/js/dashboard.js@@ -33,14 +33,7 @@ function openModal() {let $modal = $($(that).attr('href'));$modal.html(response);initSelects();- $modal.modal();- // Image checkbox selector- $('.image_select-item-overlay').on('click', function (e) {- let id = $(e.target).attr('id');- let checkbox = $('input#' + id).prop('checked');- $('input#' + id).prop('checked', !checkbox);- $(e.target).toggleClass('checked', !checkbox);- });+ $modal.modal('open');}});@@ -49,15 +42,16 @@ function openModal() {}$(document).ready(function() {+let styleGuideMenu = $('.styleguide__menu');$(window).scroll(function () {if ($(this).scrollTop() > 100) {- styleGuideMenu.addClass('fixed');+ styleGuideMenu.addClass("fixed");} else {- styleGuideMenu.removeClass('fixed');+ styleGuideMenu.removeClass("fixed");}- });+ })let mainNavTop = $('.side-nav');let $toggleMenu = $('#toggle-menu');@@ -129,6 +123,10 @@ $(document).ready(function() {}).on('click', '.modal-close', function() {$('.modal').modal('close');});++ function isTablet() {+ return !$('.hide-on-med-only').is(':visible');+ }});Dropzone.options.productImageForm = {paramName: 'image',@@ -139,6 +137,9 @@ Dropzone.options.productImageForm = {previewTemplate: $('#template').html(),clickable: false,init: function() {+ let $dropzoneMessage = $('.dropzone-message');+ let $gallery = $('.product-gallery');+this.on('success', function(e, response) {$(e.previewElement).find('.product-gallery-item-desc').html(response.image);$(e.previewElement).attr('data-id', response.id);@@ -218,10 +219,10 @@ $('.datepicker').pickadate({weekdaysShort: [ pgettext('Datepicker weekday shortcut', 'Sun'), pgettext('Datepicker weekday shortcut', 'Mon'), pgettext('Datepicker weekday shortcut', 'Tue'), pgettext('Datepicker weekday shortcut', 'Wed'), pgettext('Datepicker weekday shortcut', 'Thu'), pgettext('Datepicker weekday shortcut', 'Fri'), pgettext('Datepicker weekday shortcut', 'Sat') ],// Materialize modified- weekdaysLetter: [ pgettext('Sunday shortcut', 'S'), pgettext('Monday shortcut', 'M'), pgettext('Tuesday shortcut', 'T'), pgettext('Wednesday shortcut', 'W'), pgettext('Thursday shortcut', 'T'), pgettext('Friday shortcut', 'F'), pgettext('Saturday shortcut', 'S') ],+ weekdaysLetter: [ pgettext('Sunday shortcut','S'), pgettext('Monday shortcut','M'), pgettext('Tuesday shortcut','T'), pgettext('Wednesday shortcut','W'), pgettext('Thursday shortcut','T'), pgettext('Friday shortcut','F'), pgettext('Saturday shortcut','S') ],today: pgettext('Datepicker option', 'Today'),clear: pgettext('Datepicker option', 'Clear'),- close: pgettext('Datepicker option', 'Close'),+ close: pgettext('Datepicker option','Close'),format: 'd mmmm yyyy',formatSubmit: 'yyyy-mm-dd',@@ -270,22 +271,7 @@ $(document).ready(() => {}});+//Print button$('.btn-print').click((e) => {window.print();});--// Publish product switch-$(document).ready(() => {- let $publishUrl = $('.switch').data('url');- let $publishSwitch = $('.switch').find('[type=checkbox]');- $publishSwitch.on('change', function (e) {- $.ajax({- url: $publishUrl,- method: 'get',- success: function (response) {- location.reload();- }- });- e.preventDefault();- });-});