 
     @initAce()
 
-
     @model.bind "initialfetch",  =>
       console.log "settting HTML"
+      @removeUnsavedNotification()
       @setEditorContents @model.get "html"
+
+      @editor.getSession().on "change", =>
+        console.log "CHANGE"
+        @showUnsavedNotification()
 
     @model.bind "change", (slide) =>
 

    @model.save null,
      success: (e) =>
        @model.trigger "saved", @model

        if not @hasEditUrl()
          window.location.hash = "#edit/#{ @model.get("id") }"

    @editor = ace.edit "editor"
    @editor.setShowPrintMargin false
    HTMLmode = require("ace/mode/html").Mode
    session = @editor.getSession()
    session.setTabSize(2);
    # session.setUseWrapMode(true);
    session.setMode(new HTMLmode())


    # Hide the line numbering, doesn't work perfectly
