         , 100)
         return
 
-    editor.clickingIntoArchorForm = (e) ->
-        self = this
-        if e.type and e.type.toLowerCase() is "blur" and e.relatedTarget and e.relatedTarget in [self.anchorInput, self.contextAnchorForm]
-            return true
-        else
-            return false
+    # editor.clickingIntoArchorForm = (e) ->
+    #     self = this
+    #     console.log e
+    #     # console.log e.type
+
+    #     # console.log $(self.contextAnchorForm).has(e.target)
+    #     if e.type and e.type.toLowerCase() is "blur" and e.relatedTarget and e.relatedTarget in [self.anchorInput, self.contextAnchorForm]
+    #         return true
+    #     else
+    #         return false
 
     # End of monkey patches
 



    editor = new MediumEditor ".medium-editable",
        buttons: ['contextLink', 'bold', 'italic', 'underline'],
        extensions:
            contextLink: new ContextLinkExtension()

    console.log editor.toolbar
    editor.toolbar.appendChild(toolbarFormContextAnchor());

    editor.contextAnchorForm = editor.toolbar.querySelector('.medium-editor-toolbar-form-context-anchor');
    editor.contextAnchorForm.style.display = 'none';

    # Monkey Patches !!!
    editor.showToolbarActions = ->
        self = this
        timer = undefined
        @anchorForm.style.display = "none"
        @contextAnchorForm.style.display = "none" # This is the monkey patch
        @toolbarActions.style.display = "block"
        @keepToolbarAlive = false
        clearTimeout timer

    'click img.gifgif-button': (d) -> renderTemplate(d, Template.create_gifgif_section)
    'click img.audio-button': (d) -> renderTemplate(d, Template.create_audio_section)

Template.context_anchor_menu.rendered = ->
    @$('.context-anchor-option').on 'mousedown', (e) ->
        e.preventDefault()
        console.log 'cleeek'
        # @keepToolbarAlive = true;
        contextId =  $(e.currentTarget).data('contextId')
        document.execCommand('createLink', false, contextId);
        # contextAnchorForm.hide()
        return false


Template.create_section_options.events
    "click div#back": (d) ->
