2015-06-25 10:04:50 -04:00
|
|
|
class @IssuableContext
|
2016-03-22 20:10:56 -04:00
|
|
|
constructor: (currentUser) ->
|
2016-03-21 07:31:50 -04:00
|
|
|
@initParticipants()
|
2016-03-19 20:49:36 -04:00
|
|
|
new UsersSelect(currentUser)
|
2015-06-25 10:04:50 -04:00
|
|
|
$('select.select2').select2({width: 'resolve', dropdownAutoWidth: true})
|
|
|
|
|
2015-12-10 13:04:34 -05:00
|
|
|
$(".issuable-sidebar .inline-update").on "change", "select", ->
|
2015-06-25 10:04:50 -04:00
|
|
|
$(this).submit()
|
2015-12-10 13:04:34 -05:00
|
|
|
$(".issuable-sidebar .inline-update").on "change", ".js-assignee", ->
|
2015-06-25 10:04:50 -04:00
|
|
|
$(this).submit()
|
|
|
|
|
2016-04-19 09:32:21 -04:00
|
|
|
$(document)
|
2016-04-22 05:57:00 -04:00
|
|
|
.off 'click', '.issuable-sidebar .dropdown-content a'
|
|
|
|
.on 'click', '.issuable-sidebar .dropdown-content a', (e) ->
|
2016-04-19 09:32:21 -04:00
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
$(document)
|
|
|
|
.off 'click', '.edit-link'
|
|
|
|
.on 'click', '.edit-link', (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
$block = $(@).parents('.block')
|
|
|
|
$selectbox = $block.find('.selectbox')
|
|
|
|
if $selectbox.is(':visible')
|
|
|
|
$selectbox.hide()
|
|
|
|
$block.find('.value').show()
|
|
|
|
else
|
|
|
|
$selectbox.show()
|
|
|
|
$block.find('.value').hide()
|
|
|
|
|
|
|
|
if $selectbox.is(':visible')
|
|
|
|
setTimeout ->
|
|
|
|
$block.find('.dropdown-menu-toggle').trigger 'click'
|
|
|
|
, 0
|
|
|
|
|
2016-02-18 10:55:30 -05:00
|
|
|
$(".right-sidebar").niceScroll()
|
2016-03-21 07:31:50 -04:00
|
|
|
|
|
|
|
initParticipants: ->
|
|
|
|
_this = @
|
|
|
|
$(document).on "click", ".js-participants-more", @toggleHiddenParticipants
|
|
|
|
|
|
|
|
$(".js-participants-author").each (i) ->
|
|
|
|
if i >= _this.PARTICIPANTS_ROW_COUNT
|
|
|
|
$(@)
|
|
|
|
.addClass "js-participants-hidden"
|
|
|
|
.hide()
|
|
|
|
|
|
|
|
toggleHiddenParticipants: (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
|
|
|
|
currentText = $(this).text().trim()
|
|
|
|
lessText = $(this).data("less-text")
|
|
|
|
originalText = $(this).data("original-text")
|
|
|
|
|
|
|
|
if currentText is originalText
|
|
|
|
$(this).text(lessText)
|
|
|
|
else
|
|
|
|
$(this).text(originalText)
|
|
|
|
|
|
|
|
$(".js-participants-hidden").toggle()
|