Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Handle backslashes in layer autoname. Closes tilemill-project#1115.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhahn committed Jan 11, 2012
1 parent d79d204 commit daa4f5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion views/Layer.bones
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ view.prototype.placeholderUpdate = function(ev) {
// @TODO smarter handling for this or abandon the idea if it turns out to be
// untenable for queries.
view.prototype.autoname = function(source) {
return _(source.split('/'))
return _(source.split('/')).chain()
.map(function(chunk) { return chunk.split('\\'); })
.flatten()
.last()
.value()
.split('.')[0]
.toLowerCase()
.replace(/[^a-z0-9]/g,'')
Expand Down

0 comments on commit daa4f5a

Please sign in to comment.