kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Fix explorer scrolling and closing behavior
							rodzic
							
								
									8bf2c9bf2e
								
							
						
					
					
						commit
						301d128ea6
					
				|  | @ -1,6 +1,7 @@ | |||
| import _ from 'lodash'; | ||||
| 
 | ||||
| const fetch = global.fetch; | ||||
| const Headers = global.Headers; | ||||
| 
 | ||||
| // fetch wrapper for JSON APIs.
 | ||||
| export const get = (url) => { | ||||
|  |  | |||
|  | @ -53,11 +53,19 @@ export default class ExplorerPanel extends React.Component { | |||
| 
 | ||||
|     document.body.classList.add('explorer-open'); | ||||
|     document.addEventListener('click', this.clickOutside); | ||||
|     var Anchors = document.getElementsByTagName("a"); | ||||
|     for (var i = 0; i < Anchors.length ; i++) { | ||||
|       Anchors[i].addEventListener("click", this.clickOutside) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   componentWillUnmount() { | ||||
|     document.body.classList.remove('explorer-open'); | ||||
|     document.removeEventListener('click', this.clickOutside); | ||||
|     var Anchors = document.getElementsByTagName("a"); | ||||
|     for (var i = 0; i < Anchors.length ; i++) { | ||||
|       Anchors[i].removeEventListener("click", this.clickOutside) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   clickOutside(e) { | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ function entryPoint(filename) { | |||
|   var name = appName(filename); | ||||
|   var entryName = path.basename(filename, '.entry.js'); | ||||
|   var outputPath = path.join('wagtail', name, 'static', name, 'js', entryName); | ||||
|   return [outputPath, ['babel-polyfill', filename]]; | ||||
|   return [outputPath, ['whatwg-fetch', 'babel-polyfill', filename]]; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -46,9 +46,6 @@ module.exports = function exports() { | |||
|       publicPath: '/static/js/' | ||||
|     }, | ||||
|     plugins: [ | ||||
|       new webpack.ProvidePlugin({ | ||||
|         fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch' | ||||
|       }), | ||||
|       new webpack.optimize.CommonsChunkPlugin('common', COMMON_PATH, Infinity) | ||||
|     ], | ||||
|     module: { | ||||
|  |  | |||
|  | @ -441,9 +441,9 @@ body.explorer-open { | |||
| 
 | ||||
|     .explorer { | ||||
|         width: 400px; | ||||
|         position: absolute; | ||||
|         position: fixed; | ||||
|         top: 0; | ||||
|         left: 99%; | ||||
|         left: $menu-width; | ||||
|     } | ||||
| 
 | ||||
|     .dl-menu { | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Eirikur Ingi Magnusson
						Eirikur Ingi Magnusson