Update handler_url support to match the latest in the xblock repo, for both js and python runtimes
[LMS-1613]
This commit is contained in:
@@ -4,9 +4,21 @@
|
||||
childMap[child.name] = child
|
||||
|
||||
return {
|
||||
handlerUrl: (handlerName) ->
|
||||
# Generate the handler url for the specified handler.
|
||||
#
|
||||
# element is the html element containing the xblock requesting the url
|
||||
# handlerName is the name of the handler
|
||||
# suffix is the optional url suffix to include in the handler url
|
||||
# query is an optional query-string (note, this should not include a preceding ? or &)
|
||||
handlerUrl: (element, handlerName, suffix, query) ->
|
||||
handlerPrefix = $(element).data("handler-prefix")
|
||||
"#{handlerPrefix}/#{handlerName}"
|
||||
suffix = if suffix? then "/#{suffix}" else ''
|
||||
query = if query? then "?#{query}" else ''
|
||||
"#{handlerPrefix}/#{handlerName}#{suffix}#{query}"
|
||||
|
||||
# A list of xblock children of this element
|
||||
children: children
|
||||
|
||||
# A map of name -> child for the xblock children of this element
|
||||
childMap: childMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user