Skip to content

Commit

Permalink
Merge pull request #73 from fbonzon/dev
Browse files Browse the repository at this point in the history
Add instructions to build dist files
  • Loading branch information
aratcliffe authored Nov 11, 2016
2 parents 500b49b + 606cef8 commit 73c99ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var map = L.map('map', {
icon: 'images/zoom-out.png',
callback: zoomOut
}]
});
});


function showCoordinates (e) {
Expand Down Expand Up @@ -145,15 +145,15 @@ 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.

````javascript
unbindContextMenu()
````
Unbinds the context menu previously bound to the feature with the bindContextMenu() method.

###Events

The following events are triggered on the map:
Expand Down Expand Up @@ -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).

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
}

0 comments on commit 73c99ba

Please sign in to comment.