Fixed deploy target, new entry creation.
* Modified make target `deploy` to require the `build` target first. * When creating a new timestamp entry we no longer refresh the collection from the server. Now we use the `success` callback to set the server-supplied values on the model.
This commit is contained in:
		
							
								
								
									
										16
									
								
								www/js/ts.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								www/js/ts.js
									
									
									
									
									
								
							| @@ -351,11 +351,13 @@ $(document).ready(function(){ | ||||
|                 var entryMark = this.$("#new-entry-input").val(); | ||||
|  | ||||
|                 // create the mark. Immediately fetch to get server-side timestamp | ||||
|                 this.collection.create({mark: entryMark, | ||||
|                                         notes: '', | ||||
|                                         timestamp: new Date()}); | ||||
|  | ||||
|                 this.collection.fetch(); | ||||
|                 this.collection.create( | ||||
|                     {mark: entryMark, | ||||
|                      notes: '', | ||||
|                      timestamp: new Date()}, | ||||
|                     {wait: true, | ||||
|                      success: function(model, resp, options) { | ||||
|                         model.set(resp); }}); | ||||
|  | ||||
|                 // clear the input for the next entry | ||||
|                 this.$("#new-entry-input").val(""); } }, | ||||
| @@ -623,10 +625,10 @@ $(document).ready(function(){ | ||||
|                 this.user.model.set({last_timeline: tl.get('id')}); | ||||
|                 this.user.model.save(); | ||||
|  | ||||
|                 // refresh TimelineListView | ||||
|                 // re-render the TimelineListView | ||||
|                 this.timelines.view.render(); | ||||
|  | ||||
|                 // refresh EntryList records | ||||
|                 // fetch the new EntryList records | ||||
|                 this.entries.collection.fetch() } } }); | ||||
|  | ||||
|     TS.LoginView = Backbone.View.extend({ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user