gitlab-org--gitlab-foss/app/assets/javascripts/issue.js.coffee
Drew Blessing aedc12547a Merge branch 'issue-sidebar-size' into 'master'
Changes the width of sidebar in issues and MRs when affix event fires

Fixes #1320

Width is set when Bootstraps affix event is fired and then removed when it reaches the top or bottom.

See merge request !464
2015-04-03 13:23:11 +00:00

24 lines
898 B
CoffeeScript

class @Issue
constructor: ->
$('.edit-issue.inline-update input[type="submit"]').hide()
$(".context .inline-update").on "change", "select", ->
$(this).submit()
$(".context .inline-update").on "change", "#issue_assignee_id", ->
$(this).submit()
if $("a.btn-close").length
$("li.task-list-item input:checkbox").prop("disabled", false)
$('.task-list-item input:checkbox').off('change')
$('.task-list-item input:checkbox').change('issue', updateTaskState)
$('.issue-details').waitForImages ->
$('.issuable-affix').affix offset:
top: ->
@top = ($('.issuable-affix').offset().top - 70)
bottom: ->
@bottom = $('.footer').outerHeight(true)
$('.issuable-affix').on 'affix.bs.affix', ->
$(@).width($(@).outerWidth())
.on 'affixed-top.bs.affix affixed-bottom.bs.affix', ->
$(@).width('')