Skip to content
代码片段 群组 项目
提交 32de6691 编辑于 作者: Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
浏览文件

Merge pull request #7189 from skv-headless/fix_duplicate_event_loading

prevent events duplication loading
No related branches found
No related tags found
无相关合并请求
@Pager =
limit: 0
offset: 0
disable: false
init: (limit, preload) ->
@limit = limit
init: (@limit = 0, preload, @disable = false) ->
@loading = $(".loading")
if preload
@offset = 0
@getOld()
else
@offset = limit
@offset = @limit
@initLoadMore()
getOld: ->
$(".loading").show()
@loading.show()
$.ajax
type: "GET"
url: location.href
data: "limit=" + @limit + "&offset=" + @offset
complete: ->
$(".loading").hide()
complete: =>
@loading.hide()
success: (data) ->
Pager.append(data.count, data.html)
dataType: "json"
......@@ -39,6 +36,7 @@
ceaseFire: ->
Pager.disable
callback: (i) ->
$(".loading").show()
Pager.getOld()
callback: (i) =>
unless @loading.is(':visible')
@loading.show()
Pager.getOld()
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册