更改状态时单击按钮

Button being clicked when changing state

当我单击屏幕 1 中的蓝色收藏夹按钮时,我想调出收藏夹列表(屏幕 2),然后单击绿色收藏夹按钮进入屏幕 3。但是,当我单击单击屏幕 1 中的收藏夹按钮,我立即转到屏幕 3。我该如何解决这个问题?

||------------屏幕1------------||------------屏幕2 ----------||------------屏幕 3------------||

代码

#Show favorites page (Click blue favorites button)
$.favoritesButton.on Events.Click, ->
    #Show list of names
    $.otherCellsClickFavPage.states.switch("on")
    $.nameClickFavPage.states.switch("on")
    $.checkClickFavPage.states.switch("on")

    #Hide blue favorites button & show green favorites button 2
    $.favoritesButton.states.switchInstant("default")
    $.favoritesButton2.states.switch("on")

#Send to all favorites (Click on the green favorites button 2)
$.favoritesButton2.on Events.Click, ->
    #Show Send to All Favorites Page
    $.favoritesButtonSentToAllFav.states.switch("on")
    $.sentMessageSentToAllFav.states.switch("on")
    $.cellsSentToAllFav.states.switch("on")

    #Hide green favorites button 2 & blue favorites button, so can show pink + white favorites button
    $.favoritesButton2.states.switch("default")
    $.favoritesButton.states.switch("default")

状态 "on" 表示将不透明度设为 1,状态 "default" 表示将不透明度设为 0。绿色收藏夹按钮 2 位于蓝色收藏夹按钮之上。

已解决!我意识到我只需要将蓝色的收藏夹按钮移到绿色的收藏夹按钮上。

#Place Favorites button on top of favorites button 2
$.favoritesButton.placeBefore($.favoritesButton2)

#Show favorites page (Click favorites button)
$.favoritesButton.on Events.Click, ->
    #Show list of names
    $.otherCellsClickFavPage.states.switch("on")
    $.nameClickFavPage.states.switch("on")
    $.checkClickFavPage.states.switch("on")

    #Hide blue favorites button & show green favorites button 2
    $.favoritesButton.states.switchInstant("default")
    $.favoritesButton2.states.switch("on")

    #Place Favorites button 2 on top of favorites button
    $.favoritesButton2.placeBefore($.favoritesButton)

#Send to ALL favorites (Click on the green favorites button 2)
$.favoritesButton2.on Events.Click, ->
    #Show Send to All Favorites Page
    $.favoritesButtonSentToAllFav.states.switch("on")
    $.sentMessageSentToAllFav.states.switch("on")
    $.cellsSentToAllFav.states.switch("on")

    #Hide green favorites button 2 & blue favorites button, so can show     pink + white favorites button
    $.favoritesButton2.states.switch("off")
    $.favoritesButton.states.switch("off")

状态"off"表示将不透明度设为0。