Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions app/client/ajax.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ define ['events', 'utils/params', "utils/destroyer", "underscore"], (events, par
request.onreadystatechange = ->
return if request.readyState isnt 4 or request.status is 0

switch request.status
when 301, 302, 303
newLocation = request.getResponseHeader? "Location"
if newLocation?
window.location.href = newLocation
return

if request.status isnt 200 and request.status isnt 304
eventsSprout.trigger "error", [request, null]
eventsSprout.trigger "complete", [request, null]
Expand Down
2 changes: 1 addition & 1 deletion app/client/sections/section.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ define [
container.appendChild element

turnOnWidgets: () ->
loader.search @getSectionHtml(), (widgetsList) =>
loader.search @getSectionHtml(), (widgetsList) ->
# удобно, но пока кажется избыточным такой notify
#notifyAll "turnedOn", "-widgets", widgetsList
on
Expand Down
8 changes: 4 additions & 4 deletions app/client/utils/sections.coffee
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#### *module* utils/sections
#
# Вспомогательный модуль для загрузки модулей без использования навигационого
# Вспомогательный модуль для загрузки модулей без использования навигационого
# модуля.
# Модули загружаются без событий pageTransition.
# Модули могут быть загружены данным модулем, как вызовом на прямую, так и
# Модули могут быть загружены данным модулем, как вызовом на прямую, так и
# через параметры в ссылках.
#
#
# Загрузка модуля на прямую:
# require("utils/sections").load("UserBarWidget", "#UserBarWidget")
#
#
# Загрузка модуля через ссылку:
# <a href="./" data-reload-sections='UserBarWidget: #UserBarWidget' data-reload-params='{ "loadSectionsSilently": true }'>Text</a>
#
Expand Down