                 setup: (element) ->
                   this.setValue(element.children('.menu-item').children("input[name$='[url]']").val())
                 commit: (element) ->
-                  if this.getElement().isVisible() then value = this.getValue() else value = ''
+                  if this.getDialog().getValueOf('item', 'source') == 'URL' then value = this.getValue() else value = ''
 
                   element.children('.menu-item').children("input[name$='[url]']").val(value)
                   element.children('a').attr('href', value || '#')
                 validate: ->
-                  if this.getElement().isVisible() && (this.getValue() || '').length == 0
+                  if this.getDialog().getValueOf('item', 'source') == 'URL' && (this.getValue() || '').length == 0
                     CKEDITOR.dialog.validate.notEmpty('please enter a URL').apply(this)
               },
               {

                  if this.getDialog().getValueOf('item', 'source') == 'Divider'
                    element.children('.menu-item').children("input[name$='[special]']").val('divider')
                    element.children('a').html('')
                  else if this.getElement().isVisible()
                    element.children('.menu-item').children("input[name$='[special]']").val(this.getValue())
                  else
                    element.children('.menu-item').children("input[name$='[special]']").val('')

    $('.effective-menu').effectiveMenuEditor() # Initialize the EffectiveMenus

    CKEDITOR.dialog.add 'effectiveMenusDialog', (editor) ->
      {
        title: 'Effective Menu Item'
        minWidth: 350,
        minHeight: 200,
