mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-11-03 20:05:53 +01:00 
			
		
		
		
	Allow new media collapser logic to configure different cookie storage name location via data-storage-location
				
					
				
			This commit is contained in:
		@@ -5,6 +5,7 @@
 | 
			
		||||
  * Require **Form 6.0.1**
 | 
			
		||||
2. [](#improved)
 | 
			
		||||
   * Added support for a single `field:` vs `fields:` in element form field to store a single value to the option field
 | 
			
		||||
   * Allow new media collapser logic to configure different cookie storage name location via `data-storage-location`
 | 
			
		||||
1. [](#bugfix)
 | 
			
		||||
   * Fixed nested element form fields
 | 
			
		||||
   * Fixed `columns` and `column` fields with `.dotted` variables inside to ignore columns and column names
 | 
			
		||||
 
 | 
			
		||||
@@ -245,7 +245,8 @@ export const updateMediaSizes = (input, width, store = true) => {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const updateMediaCollapseStatus = (element, store = true) => {
 | 
			
		||||
  const status = JSON.parse(Cookies.get('grav-admin-pagemedia') || '{}');
 | 
			
		||||
  const storageLocation = element.dataset.storageLocation || 'grav-admin-pagemedia';
 | 
			
		||||
  const status = JSON.parse(Cookies.get(storageLocation) || '{}');
 | 
			
		||||
 | 
			
		||||
  element = $(element);
 | 
			
		||||
  const icon = element.find('i.fa');
 | 
			
		||||
@@ -262,7 +263,7 @@ export const updateMediaCollapseStatus = (element, store = true) => {
 | 
			
		||||
 | 
			
		||||
  if (store) {
 | 
			
		||||
    const data = Object.assign({}, status, { collapsed });
 | 
			
		||||
    Cookies.set('grav-admin-pagemedia', JSON.stringify(data), { expires: Infinity });
 | 
			
		||||
    Cookies.set(storageLocation, JSON.stringify(data), { expires: Infinity });
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16181
									
								
								themes/grav/js/admin.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16181
									
								
								themes/grav/js/admin.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										90108
									
								
								themes/grav/js/vendor.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										90108
									
								
								themes/grav/js/vendor.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user