-
Notifications
You must be signed in to change notification settings - Fork 134
leafletDraw #184
leafletDraw #184
Conversation
grunt-karma and fire up karma ourselves. feat(leaflet.Draw, draw directive): Leaflet.Draw is now supported.
@@ -9,7 +9,7 @@ root = true | |||
|
|||
# Change these settings to your own preference | |||
indent_style = space | |||
indent_size = 4 | |||
indent_size = 2 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start using 2 space indent. I'll fix it as I go; or I can do all the files in another follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editors tend to pick what's around, so it might be good idea to do one massive PR instead of leaving mixed styles behind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id rather not do all of it right now as it makes it even harder to review. Ill do it immediately after this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, absolutely, indentation PR has to have only spaces changed and nothing else.
We had this with Meanjs and it was good to watch for a moment with minimum amount of PR's pending.
should this PR be on leaflet-1.X branch? We talk about plugins for version 2, no? |
On the another hand, I like this changes, 👍 |
angular.module('ui-leaflet') | ||
.factory('leafletDrawEvents', function(leafletEventsHelpersFactory) { | ||
|
||
class DrawEvents extends leafletEventsHelpersFactory{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW I thought the Babel compiled code to this was quite comical. As people who hate CoffeeScript babel's output is way way harder to read. I almost would rather revert this to ES5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vs
angular.module('ui-leaflet')
.factory 'leafletDrawEvents', (leafletEventsHelpersFactory) ->
class DrawEvents extends leafletEventsHelpersFactory
constructor: () ->
super('leafletDirectiveDraw', 'draw')
getAvailableEvents: () ->
return [
'created'
'edited'
'deleted'
'drawstart'
'drawstop'
'editstart'
'editstop'
'deletestart'
'deletestop'].map (n) ->
return 'draw:' + n
new DrawEvents()
yeilds:
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
angular.module('ui-leaflet').factory('leafletDrawEvents', function(leafletEventsHelpersFactory) {
var DrawEvents;
return DrawEvents = (function(superClass) {
extend(DrawEvents, superClass);
function DrawEvents() {
DrawEvents.__super__.constructor.call(this, 'leafletDirectiveDraw', 'draw');
}
DrawEvents.prototype.getAvailableEvents = function() {
return ['created', 'edited', 'deleted', 'drawstart', 'drawstop', 'editstart', 'editstop', 'deletestart', 'deletestop'].map(function(n) {
return 'draw:' + n;
});
};
new DrawEvents();
return DrawEvents;
})(leafletEventsHelpersFactory);
});
// ---
// generated by coffee-script 1.9.2
@elesdoar no, I need these changes now for work. Plus this is backwards compatible but done in a more modular way. I plan on switching the other directives to be like this as well with the angular.config. |
@@ -9,6 +9,11 @@ | |||
"type": "git", | |||
"url": "https://github.com/angular-ui/ui-leaflet" | |||
}, | |||
"scripts": { | |||
"test": "grunt travis --verbose", | |||
"karma": "karma start ./test/karma.conf.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note besides grunt karma
you can run npm run karma
now.
I plan on having a follow up PR for documentation and more specs. As well as fixing directiveControls, and leafletData. |
@elesdoar your right, I will put all the leaflet draw stuff into a sep repo. This PR will become just karma, grunt, and babel fixes. |
Closing for plugin / component repo for ui-leaflet-draw. |
Don't merge this yet. It is mainly to start getting eyes on this.
Still needs:
Can make an additional PR as this is 37 files already.