     # This way the saves happen all at once
 
     serialize: (retval) ->
+      return if @menu.data('dirty') != true
+
       # console.log "============ BEFORE =============="
       # @menu.find('li').each (index, item) =>
       #   item = $(item)

      @menu.on 'click', 'li.dropdown.open,.dropdown-menu > li.dropdown,li:not(.dropdown)', (event) =>
        event.stopPropagation()
        @menu.find('.open').removeClass('open')
        # Open the CKEDITOR dialog and pass the source effective_menu_item $('li') to the dialog
        CKEDITOR.instances[Object.keys(CKEDITOR.instances)[0]].openDialog 'effectiveMenusDialog', (dialog) ->
          dialog.effective_menu_item = $(event.currentTarget)

      # This retVal has to account for multiple effective-menus on one page
      retval[@menu.data('effective-menu-id')] = items

    saveComplete: (data) -> @menu.data('dirty', false)

    assignLftRgt: (parent, lft) ->
      rgt = lft + 1

      parent.children('.dropdown-menu').children('li').each (_, child) =>
        rgt = @assignLftRgt($(child), rgt)

      parent.children('li').each (_, child) =>
        rgt = @assignLftRgt($(child), rgt)

      parent.children('.menu-item').children("input[name$='[lft]']").val(lft)
