fixing some site bugs.

This commit is contained in:
Jeremy Ashkenas 2010-12-12 21:53:17 -05:00
parent 9785fd0333
commit b5bd58b2b6
3 changed files with 16 additions and 21 deletions

View File

@ -315,7 +315,6 @@ div.code {
#repl_results { #repl_results {
text-transform: none; text-transform: none;
overflow-y: auto; overflow-y: auto;
width: 370px;
left: 50%; left: 50%;
border-left-color: #555; border-left-color: #555;
} }

View File

@ -1510,29 +1510,27 @@ coffee --bare --print --stdio</pre>
window.loadConsole = (coffee) -> window.loadConsole = (coffee) ->
$('#repl_source').val coffee $('#repl_source').val coffee
compileSource() compileSource()
$('.navigation.try').addClass 'active' $('.navigation.try').addClass('active')
false
currentNav = null
# Helper to hide the menus. # Helper to hide the menus.
closeMenus = -> closeMenus = ->
if currentNav $('.navigation.active').removeClass 'active'
currentNav.removeClass 'active'
currentNav = null
# Bind navigation buttons to open the menus. # Bind navigation buttons to open the menus.
$('.navigation').click (e) -> $('.navigation').click (e) ->
return if e.target.tagName.toLowerCase() is 'a' return if e.target.tagName.toLowerCase() is 'a'
return false if $(e.target).closest('.repl_wrapper').length return false if $(e.target).closest('.repl_wrapper').length
if this is (currentNav and currentNav[0]) if $(this).hasClass('active')
closeMenus() closeMenus()
else else
closeMenus() closeMenus()
currentNav = $(this) $(this).addClass 'active'
currentNav.addClass 'active'
false false
$(document.body).click -> closeMenus() $(document.body).click (e) ->
return false if $(e.target).hasClass('minibutton')
closeMenus()
$('#open_webchat').click -> $('#open_webchat').click ->
$(this).replaceWith $('<iframe src="http://webchat.freenode.net/?channels=coffeescript" width="625" height="400"></iframe>') $(this).replaceWith $('<iframe src="http://webchat.freenode.net/?channels=coffeescript" width="625" height="400"></iframe>')

View File

@ -2396,29 +2396,27 @@ task(<span class="String"><span class="String">'</span>build:parser<span class="
window.loadConsole = (coffee) -> window.loadConsole = (coffee) ->
$('#repl_source').val coffee $('#repl_source').val coffee
compileSource() compileSource()
$('.navigation.try').addClass 'active' $('.navigation.try').addClass('active')
false
currentNav = null
# Helper to hide the menus. # Helper to hide the menus.
closeMenus = -> closeMenus = ->
if currentNav $('.navigation.active').removeClass 'active'
currentNav.removeClass 'active'
currentNav = null
# Bind navigation buttons to open the menus. # Bind navigation buttons to open the menus.
$('.navigation').click (e) -> $('.navigation').click (e) ->
return if e.target.tagName.toLowerCase() is 'a' return if e.target.tagName.toLowerCase() is 'a'
return false if $(e.target).closest('.repl_wrapper').length return false if $(e.target).closest('.repl_wrapper').length
if this is (currentNav and currentNav[0]) if $(this).hasClass('active')
closeMenus() closeMenus()
else else
closeMenus() closeMenus()
currentNav = $(this) $(this).addClass 'active'
currentNav.addClass 'active'
false false
$(document.body).click -> closeMenus() $(document.body).click (e) ->
return false if $(e.target).hasClass('minibutton')
closeMenus()
$('#open_webchat').click -> $('#open_webchat').click ->
$(this).replaceWith $('<iframe src="http://webchat.freenode.net/?channels=coffeescript" width="625" height="400"></iframe>') $(this).replaceWith $('<iframe src="http://webchat.freenode.net/?channels=coffeescript" width="625" height="400"></iframe>')