Browse Source

Reorder ghost effect, loading effect (on save)

Vova Tkach 5 years ago
parent
commit
9409b4d26f

+ 0 - 1
assets/cp.scripts.js

@@ -7636,7 +7636,6 @@
 						action: action,
 						action: action,
 						data: JSON.stringify(orderData),
 						data: JSON.stringify(orderData),
 					},
 					},
-					dataType: 'json'
 				}).done(function(data) {
 				}).done(function(data) {
 					if(IsDebugMode()) console.log('done', data);
 					if(IsDebugMode()) console.log('done', data);
 					AjaxDone(data);
 					AjaxDone(data);

File diff suppressed because it is too large
+ 0 - 0
assets/cp.scripts.js.go


+ 16 - 0
assets/cp.styles.css

@@ -1027,6 +1027,22 @@ ul.pagination {
 	fill: currentColor;
 	fill: currentColor;
 }
 }
 
 
+#list-images .attached-img.sortable-ghost {
+	opacity: 0.1;
+}
+
+#list-images.loading {
+	background: #fff url('/assets/cp/img-load.gif') no-repeat 50% 50%;
+}
+
+#list-images.loading .attached-img {
+	opacity: 0.1;
+}
+
+#list-images.loading .attached-img a.remove {
+	display: none;
+}
+
 #upload-msg {
 #upload-msg {
 	position: absolute;
 	position: absolute;
 	background: white;
 	background: white;

File diff suppressed because it is too large
+ 0 - 0
assets/cp.styles.css.go


+ 1 - 1
modules/module_shop.go

@@ -1055,7 +1055,7 @@ func (this *Modules) RegisterModule_Shop() *Module {
 							`</div>` +
 							`</div>` +
 							`</div>` +
 							`</div>` +
 							`</div>` +
 							`</div>` +
-							`<script>WaitForFave(function(){Sortable.create(document.getElementById('list-images'),{animation:0,onEnd:function(evt){var orderData=[];$('#list-images div.attached-img').each(function(i,v){orderData.push({Id:$(v).data('id'),Order:i+1});});fave.ShopProductsImageReorder('shop-images-reorder',{Items:orderData});},});});</script>`
+							`<script>WaitForFave(function(){Sortable.create(document.getElementById('list-images'),{animation:0,onEnd:function(evt){var orderData=[];$('#list-images div.attached-img').each(function(i,v){orderData.push({Id:$(v).data('id'),Order:i+1});});$('#list-images').addClass('loading');fave.ShopProductsImageReorder('shop-images-reorder',{Items:orderData});},});});</script>`
 					},
 					},
 				},
 				},
 				{
 				{

+ 3 - 0
modules/module_shop_act_images_reorder.go

@@ -48,5 +48,8 @@ func (this *Modules) RegisterAction_ShopImagesReorder() *Action {
 		wrap.RecreateProductXmlFile()
 		wrap.RecreateProductXmlFile()
 
 
 		wrap.ResetCacheBlocks()
 		wrap.ResetCacheBlocks()
+
+		// Remove loading effect
+		wrap.Write(`$('#list-images').removeClass('loading');`)
 	})
 	})
 }
 }

Some files were not shown because too many files changed in this diff