Auth bug fixed

This commit is contained in:
magnolia-fan
2011-07-02 18:10:59 +04:00
parent f331533a29
commit f92693d847
4 changed files with 25 additions and 18 deletions
+11 -8
View File
@@ -10,7 +10,7 @@ _settings = null
$ ->
l = document.location
if l.host not in ['beathaven.org', 'local.beathaven.org']
if l.host not in ['beathaven.org', 'dev.beathaven.org']
l.href = 'http://beathaven.org/'+ l.hash
_beathaven = new BeatHaven()
@@ -18,6 +18,7 @@ $ ->
$(window).resize ->
_beathaven.adjustSizes()
_beathaven.redrawScrollbar()
false
window.setTimeout ->
_beathaven.checkRedrawScrollbar()
@@ -65,9 +66,9 @@ class BeatHaven
if document.activeElement.id?
focused_id = document.activeElement.id;
outer_height = $('.data-container > div').outerHeight()
if outer_height > 300 and outer_height != @last_height
@last_height = outer_height
this.redrawScrollbar()
if outer_height > 300 and outer_height != _beathaven.last_height
_beathaven.last_height = outer_height
_beathaven.redrawScrollbar()
if focused_id
document.getElementById(focused_id).focus()
focused_id = false
@@ -82,15 +83,17 @@ class BeatHaven
$('.data-container').scrollbar()
false
localizeHTML: (obj) ->
localizeHTML: (obj, lang) ->
unless obj?
obj = $('body')
unless lang?
lang = _beathaven.lang
$(obj).find('[data-ls]').each ->
if _locale[$(this).attr 'data-ls']? and _locale[$(this).attr 'data-ls'][_beathaven.lang]?
if _locale[$(this).attr 'data-ls']? and _locale[$(this).attr 'data-ls'][lang]?
if this.nodeName is 'INPUT'
$(this).val _locale[$(this).attr 'data-ls'][_beathaven.lang]
$(this).val _locale[$(this).attr 'data-ls'][lang]
else
$(this).text _locale[$(this).attr 'data-ls'][_beathaven.lang]
$(this).text _locale[$(this).attr 'data-ls'][lang]
return obj
ls: (id, lang) ->
+1 -1
View File
@@ -13,7 +13,7 @@ class Session
setUser: (user) ->
@user = user
_beathaven.lang = @user.lang
_beathaven.lang = @user.lang || 'ru'
_beathaven.localizeHTML()
false