Permalink
Browse files

date object created in wiki.putAction

  • Loading branch information...
1 parent 6130f05 commit e08ff561bbd5e3648faebb2cc9bfb302573ce522 @hallahan hallahan committed Apr 18, 2012
Showing with 7 additions and 6 deletions.
  1. +3 −2 client/lib/legacy.coffee
  2. +4 −4 client/lib/refresh.coffee
View
@@ -92,6 +92,7 @@ $ ->
$(".login").length > 0
putAction = wiki.putAction = (pageElement, action) ->
+ action.date = (new Date()).getTime()
if (site = pageElement.data('site'))?
action.fork = site
pageElement.find('h1 img').attr('src', '/favicon.png')
@@ -136,9 +137,9 @@ $ ->
if item.text = textarea.val()
plugin.do div.empty(), item
return if item.text == original
- putAction div.parents('.page:first'), {type: 'edit', id: item.id, item: item, date: (new Date()).getTime()}
+ putAction div.parents('.page:first'), {type: 'edit', id: item.id, item: item}
else
- putAction div.parents('.page:first'), {type: 'remove', id: item.id, date: (new Date()).getTime()}
+ putAction div.parents('.page:first'), {type: 'remove', id: item.id}
div.remove()
null
.bind 'keydown', (e) ->
@@ -18,14 +18,14 @@ handleDragging = (evt, ui) ->
action = if moveWithinPage
order = $(this).children().map((_, value) -> $(value).attr('data-id')).get()
- {type: 'move', order: order, date: (new Date()).getTime()}
+ {type: 'move', order: order}
else if moveFromPage
- {type: 'remove', date: (new Date()).getTime()}
+ {type: 'remove'}
else if moveToPage
itemElement.data 'pageElement', thisPageElement
beforeElement = itemElement.prev('.item')
before = wiki.getItem(beforeElement)
- {type: 'add', item: item, after: before?.id, date: (new Date()).getTime()}
+ {type: 'add', item: item, after: before?.id}
action.id = item.id
wiki.putAction thisPageElement, action
@@ -47,7 +47,7 @@ initAddButton = (pageElement) ->
plugin.do itemElement, item
beforeElement = itemElement.prev('.item')
before = wiki.getItem(beforeElement)
- wiki.putAction pageElement, {item: item, id: item.id, type: "add", after: before?.id, date: (new Date()).getTime()}
+ wiki.putAction pageElement, {item: item, id: item.id, type: "add", after: before?.id}
emitHeader = (pageElement, page) ->
site = $(pageElement).data('site')

0 comments on commit e08ff56

Please sign in to comment.