Fix various small issues from animation changes

This commit is contained in:
Andrew Miner
2015-03-21 19:48:18 -07:00
parent d0d0f65233
commit 40efc8ccc9
12 changed files with 36 additions and 32 deletions
@@ -13,8 +13,9 @@ BaseController = require './base_controller'
module.exports = class AdsenseController extends BaseController
constructor: (options={})->
options.model ?= 'skyscraper_sidebar'
options.templateName = "adsense_#{options.model}"
options.model ?= 'skyscraper_sidebar'
options.tagName = 'ins'
options.templateName = "adsense_#{options.model}"
super options
@_adsEnabled = global.env in ProductionEnvs
@@ -118,14 +118,17 @@ module.exports = class InventoryTableController extends BaseController
super
refresh: ->
@$editPanel.css display:(if @editable then 'table-row' else 'none')
@$toolbar.css display:(if @editable then 'block' else 'none')
@$scrollbox.css bottom:(if @editable then @$toolbar.height() else '0')
if @editable
@show @$editPanel
@show @$toolbar, =>
@$scrollbox.css bottom:@$toolbar.height()
else
@hide @$editPanel
@hide @$toolbar
@$scrollbox.css bottom:0
if _.isEmpty(@$quantityField.val()) then @$quantityField.val '1'
@$table.find('tr:not(:last-child)').remove()
@_refreshNameAutocomplete()
@_refreshButtonState()
@_refreshStacks()
@@ -43,7 +43,6 @@ module.exports = class ItemPageController extends PageController
craftingPlanButtonClicked: ->
display = @modPack.findItemDisplay @model.item.slug
logger.debug "button clicked, going to: #{display.craftingUrl}"
router.navigate display.craftingUrl, trigger:true
return false
@@ -170,24 +170,26 @@ module.exports = class ModPageController extends PageController
@show @$tutorialsSection
else
@hide @tutorialsSection
@hide @$tutorialsSection
_refreshVersions: ->
@$versionSelector.empty()
return unless @model?
@$versionSelector.removeClass 'hiding'
if @model?
effectiveModVersion = @effectiveModVersion
versionCount = 0
@model.eachModVersion (modVersion)=>
option = $("<option value=\"#{modVersion.version}\">#{modVersion.version}</option>")
if modVersion is effectiveModVersion
option.attr 'selected', 'selected'
@$versionSelector.append option
versionCount++
effectiveModVersion = @effectiveModVersion
versionCount = 0
@model.eachModVersion (modVersion)=>
option = $("<option value=\"#{modVersion.version}\">#{modVersion.version}</option>")
if modVersion is effectiveModVersion
option.attr 'selected', 'selected'
@$versionSelector.append option
versionCount++
if versionCount <= 1
@$versionSelector.attr 'disabled', 'disabled'
else
@$versionSelector.removeAttr 'disabled'
if versionCount <= 1
@$versionSelector.attr 'disabled', 'disabled'
@show @$versionSelector
else
@$versionSelector.removeAttr 'disabled'
@hide @$versionSelector
+1 -2
View File
@@ -164,9 +164,8 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
showDuration = Duration.normal
switchToNextController = (event)=>
logger.debug "show called: #{event}"
@_resetGlobals()
@_controller.unrender() if @_controller?
@_resetGlobals()
@_page = page
@_controller = controller