Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Jan 24, 2012
1 parent 7eb0e7a commit 5cbc6cd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
25 changes: 15 additions & 10 deletions app/assets/javascripts/app/index.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ class App extends Spine.Controller
super

@el.hide()
@toggleSpinner(true)

@spinner = $('<div />').addClass('spinner')
@el.parent().append(@spinner)
@spinner.spin(
length: 7, width: 4,
color: 'rgba(255, 255, 255, 0.5)'
)

@append new App.Nav
@append new App.Stack
@append(@nav = new App.Nav)
@append(@stack = new App.Stack)

App.ready =>
@el.queueNext =>
Expand All @@ -60,7 +54,7 @@ class App extends Spine.Controller
scale: '1'
opacity: '1'

@spinner.remove()
@toggleSpinner(false)

App.ready ->
App.Conversation.fetchStarred()
Expand All @@ -73,6 +67,17 @@ class App extends Spine.Controller
Spine.Route.setup()
App.ready()

toggleSpinner: (show) ->
if show
@spinner = $('<div />').addClass('spinner')
@el.parent().append(@spinner)
@spinner.spin(
length: 7, width: 4,
color: 'rgba(255, 255, 255, 0.5)'
)
else
@spinner?.remove()

clickLink: (e) ->
e.preventDefault()
href = $(e.target).attr('href')
Expand Down
5 changes: 2 additions & 3 deletions app/assets/javascripts/app/spine/spine.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ class Model extends Module
@toString: -> "#{@className}(#{@attributes.join(", ")})"

@find: (id) ->
if ("#{id}").match(/c-\d+/)
return @findCID(id)

record = @records[id]
if !record and ("#{id}").match(/c-\d+/)
return @findCID(id)
throw('Unknown record') unless record
record.clone()

Expand Down
2 changes: 2 additions & 0 deletions doc/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Email conversation style, with an integrated workflow.
// * Sleep/wake events
// * Track exceptions

Show all unread or received_at > 1.day.ago

Later:

* Attachments
Expand Down
Binary file modified macgap/application.icns
Binary file not shown.
Binary file modified macgap/application3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5cbc6cd

Please sign in to comment.