mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
Prepared diff view for multiple view modes Converted commits.js to coffeescript image info in separate coffeescript file Added swipe view mode Added onion skin viewMode
54 lines
1.0 KiB
CoffeeScript
54 lines
1.0 KiB
CoffeeScript
class CommitsList
|
|
@data =
|
|
ref: null
|
|
limit: 0
|
|
offset: 0
|
|
@disable = false
|
|
|
|
@showProgress: ->
|
|
$('.loading').show()
|
|
|
|
@hideProgress: ->
|
|
$('.loading').hide()
|
|
|
|
@init: (ref, limit) ->
|
|
$(".day-commits-table li.commit").live 'click', (event) ->
|
|
if event.target.nodeName != "A"
|
|
location.href = $(this).attr("url")
|
|
e.stopPropagation()
|
|
return false
|
|
|
|
@data.ref = ref
|
|
@data.limit = limit
|
|
@data.offset = limit
|
|
|
|
this.initLoadMore()
|
|
this.showProgress();
|
|
|
|
@getOld: ->
|
|
this.showProgress()
|
|
$.ajax
|
|
type: "GET"
|
|
url: location.href
|
|
data: @data
|
|
complete: this.hideProgress
|
|
dataType: "script"
|
|
|
|
@append: (count, html) ->
|
|
$("#commits-list").append(html)
|
|
if count > 0
|
|
@data.offset += count
|
|
else
|
|
@disable = true
|
|
|
|
@initLoadMore: ->
|
|
$(document).endlessScroll
|
|
bottomPixels: 400
|
|
fireDelay: 1000
|
|
fireOnce: true
|
|
ceaseFire: =>
|
|
@disable
|
|
callback: =>
|
|
this.getOld()
|
|
|
|
this.CommitsList = CommitsList |