 
           for o in toOptions
             to.element.add o, null
-
-          @selected.trigger events.palette.didChange, memo
-
-          @updateAfterChange()
-
-        memo =
-          selectedValues: _.pluck selectedOptions, "value"
-          reorder: false
-          cancel: -> canceled = true
-          defer: ->
-            canceled = true
-            return doUpdate
-
-        @selected.trigger events.palette.willChange, memo
-
-        doUpdate() unless canceled
-
-        # Remove the movers (the selected from elements):
-
 
       insertOption: (options, option, atEnd) ->
 


        selectedOptions = if to is @selected then toOptions else fromOptions

        canceled = false

        doUpdate = =>
          for i in [(from.element.length - 1)..0] by -1
            if from.element.options[i].selected
              from.element.remove i

      # didUpdate events.
      reorderSelected: (options) ->

        @performUpdate true, options, =>

          @deleteOptions @selected

          for o in options
            @selected.element.add o, null

      # Performs the update, which includes the willChange and didChange events.
      performUpdate: (isReorder, selectedOptions, updateCallback) ->

        canceled = false
        selectedValues = _.pluck selectedOptions, "value"

        doUpdate = =>
          updateCallback()

          @selected.trigger events.palette.didChange, { selectedValues }

          @updateAfterChange()

        memo =
          selectedValues: selectedValues
          reorder: isReorder
          cancel: -> canceled = true
          defer: ->
            canceled = true
