Skip to content

Commit

Permalink
Revert #103
Browse files Browse the repository at this point in the history
  • Loading branch information
adamschwartz committed Feb 18, 2015
1 parent 2bb8bd7 commit 2a7e978
Show file tree
Hide file tree
Showing 12 changed files with 1,320 additions and 1,800 deletions.
15 changes: 0 additions & 15 deletions coffee/vex.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ vexFactory = ($) ->

vex.setupBodyClassName options.$vex

# Set up body padding to account for possible scrollbar

vex.setupBodyPadding options.$vex

# Call afterOpen callback and trigger vexOpen event

options.afterOpen options.$vexContent, options if options.afterOpen
Expand Down Expand Up @@ -184,24 +180,13 @@ vexFactory = ($) ->
.bind('vexOpen.vex', -> $('body').addClass(vex.baseClassNames.open))
.bind('vexAfterClose.vex', -> $('body').removeClass(vex.baseClassNames.open) unless vex.getAllVexes().length)

setupBodyPadding: ($vex) ->
$('body')
.bind('vexOpen.vex', -> $('body').css('padding-right', vex.getScrollbarWidth()))
.bind('vexAfterClose.vex', -> $('body').css('padding-right', 0) unless vex.getAllVexes().length)

hideLoading: ->
$('.vex-loading-spinner').remove()

showLoading: ->
vex.hideLoading()
$('body').append("""<div class="vex-loading-spinner #{vex.defaultOptions.className}"></div>""")

getScrollbarWidth: ->
$scrollDiv = $('<div class="vex-scrollbar-measure"></div>').appendTo('body')
scrollbarWidth = ($scrollDiv[0].offsetWidth - $scrollDiv[0].clientWidth)
$scrollDiv.remove()
return scrollbarWidth

if typeof define is 'function' and define.amd
# AMD
define ['jquery'], vexFactory
Expand Down
Loading

0 comments on commit 2a7e978

Please sign in to comment.