diff --git a/README.md b/README.md index 3b852c8..270b836 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ var map = L.map('map', { icon: 'images/zoom-out.png', callback: zoomOut }] -}); +}); function showCoordinates (e) { @@ -145,7 +145,7 @@ Returns `true` if the context menu is currently visible. The following methods are available on supported layer types when using the context menu mixin. ````javascript -bindContextMenu(contextMenuOptions) +bindContextMenu(contextMenuOptions) ```` Binds a context menu to the feature the method is called on. @@ -153,7 +153,7 @@ Binds a context menu to the feature the method is called on. unbindContextMenu() ```` Unbinds the context menu previously bound to the feature with the bindContextMenu() method. - + ###Events The following events are triggered on the map: @@ -221,6 +221,14 @@ Fired when a menu item is disabled. | contextmenu | Map.ContextMenu | The context menu. | el | HTMLElement | The context menu item element. +##Development + +Edit files in `src/`. To build the files in `dist/`, run: + +````shell +npm install +npm run build +```` + ##License This software is released under the [MIT licence](http://www.opensource.org/licenses/mit-license.php). Icons used in the example are from [http://glyphicons.com](http://glyphicons.com). - diff --git a/package.json b/package.json index e85195e..46dc3da 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "concat": "cat src/copyright.js src/Map.ContextMenu.js src/Mixin.ContextMenu.js src/end.js > dist/leaflet.contextmenu.js", - "compress": "uglifyjs dist/leaflet.contextmenu.js -m --comments -o dist/leaflet.contextmenu.min.js; uglifycss dist/leaflet.contextmenu.css > dist/leaflet.contextmenu.min.css", + "compress": "node_modules/uglify-js/bin/uglifyjs dist/leaflet.contextmenu.js -m --comments -o dist/leaflet.contextmenu.min.js; node_modules/uglifycss/uglifycss dist/leaflet.contextmenu.css > dist/leaflet.contextmenu.min.css", "build": "npm run concat && npm run compress" }, "repository": { @@ -29,6 +29,7 @@ }, "homepage": "https://github.com/aratcliffe/Leaflet.contextmenu", "devDependencies": { - "uglifyjs": "^2.3.6" + "uglify-js": "^2.7.4", + "uglifycss": "^0.0.25" } }