Commit 02fc0d99

mo khan <mo@mokhan.ca>
2015-01-29 04:22:17
dont show error as soon as you load the new tutorial page.
1 parent dc59cb4
Changed files (1)
app
assets
javascripts
backbone
views
app/assets/javascripts/backbone/views/tutorials/new_view.js.coffee
@@ -21,9 +21,9 @@ class CakeSide.Views.Tutorials.NewView extends Marionette.ItemView
     @service = new EmbedlyService()
 
   loadUrl: ->
-    @updateTutorial(url: @ui.url.val())
     if @model.isValidUrl(@ui.url.val())
       @service.retrieve_info_on(@ui.url.val(), @updateTutorial)
+    @validate()
 
   updateTutorial: (attributes) =>
     @model.set
@@ -36,6 +36,8 @@ class CakeSide.Views.Tutorials.NewView extends Marionette.ItemView
 
   onRender: ->
     @ui.tags.tagit({ availableTags: ALL_TAGS })
+
+  validate: ->
     @model.isValid()
 
   displayError: (model, error) ->