mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
move js genreated for ajax calls into their own object to prevent name clashes
I only modified the js that is most likely to be used in cocurrent calls. This because we start the development of Tracks 3 that will change all js.
This commit is contained in:
parent
f0871738e9
commit
4cdbd9a451
14 changed files with 436 additions and 410 deletions
|
|
@ -236,4 +236,10 @@ module ApplicationHelper
|
|||
source_view_is_one_of(:project, :context) ? "#{@source_view}-#{eval("@#{@source_view}.id")}" : @source_view
|
||||
end
|
||||
|
||||
# create a unique object name which can be used in ajax calls returning js
|
||||
# to prevent concurrent calls with same functions to overwrite each other functions
|
||||
def unique_object_name_for(name)
|
||||
"#{name}_#{SecureRandom.hex(5)}"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue