         editor
 
     # Show editor on click on label
-    startEdit = ({currentTarget}) ->
-        currentLabelHint = $(currentTarget)
-        # Find control for this label
-        th = currentLabelHint.parents('th')
-        currentControl =
-            if th.is('*')
-                # Case of a repeat
-                trWithControls = th.parents('table').find('tbody tr.fb-grid-tr').first()
-                tdWithControl = trWithControls.children(':nth-child(' + (th.index() + 1) + ')')
-                tdWithControl.find('.xforms-control, .xbl-component')
-            else
-                currentLabelHint.parents('.xforms-control, .xbl-component').first()
+    startEdit = () ->
         # Remove `for` so browser doesn't set the focus to the control on click
         currentLabelHint.removeAttr('for')
         # Setup tooltip for editor (don't do this once for all, as the language can change)

        labelHintEditor().textfield.val(labelHintValue()).focus()
        labelHintEditor().checkbox.prop('checked', isLabelHintHtml())

    $('.fb-main').on('click', LabelHintSelector, startEdit)


$ ->
    Builder = ORBEON.Builder
    OD = ORBEON.xforms.Document

    LabelHintSelector = '.fr-editable .xforms-label, .fr-editable .xforms-hint'
    ControlSelector = '.xforms-control, .xbl-component'

    # Global state
    currentControl = null
