gitlab-org--gitlab-foss/app/assets/javascripts/issuable_context.js.coffee
Robert Speicher 68b15af46c Fix IssuableContext javascript
We were calling `affix` before the events were bound so they never
triggered correctly.

Closes #2597
2015-09-18 16:35:38 -04:00

23 lines
748 B
CoffeeScript

#= require jquery.waitforimages
class @IssuableContext
constructor: ->
new UsersSelect()
$('select.select2').select2({width: 'resolve', dropdownAutoWidth: true})
$(".context .inline-update").on "change", "select", ->
$(this).submit()
$(".context .inline-update").on "change", ".js-assignee", ->
$(this).submit()
$('.issuable-details').waitForImages ->
$('.issuable-affix').on 'affix.bs.affix', ->
$(@).width($(@).outerWidth())
.on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
$(@).width('')
$('.issuable-affix').affix offset:
top: ->
@top = ($('.issuable-affix').offset().top - 70)
bottom: ->
@bottom = $('.footer').outerHeight(true)