Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/simrou.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Simrou
@resolve(hash, 'get')

# Resolves a hash. Method is optional, returns true if matching route found.
resolve: (hash, method) ->
resolve: (hash, method, data) ->
# Strip unwanted characters from the hash
cleanHash = String(hash).replace(@RegExpCache.trimHash, '$1')
if cleanHash is ''
Expand All @@ -85,9 +85,12 @@ class Simrou
params = route.match(cleanHash)
unless params
continue

# Prepend the arguments array with the method
args = [params, method]
if method in ['post', 'put']
args = [params, method, data]
else
args = [params, method]

# Trigger wildcard event
$route = jQuery(route)
Expand Down