Class: AttributeEditingAction

sync.actions. AttributeEditingAction


new AttributeEditingAction(opt_handler, opt_buttonClass, opt_tooltip)

Base class for attribute editing actions.
Parameters:
Name Type Description
opt_handler function A handler function, see the "actionPerformed" prototype documentation for more details.
opt_buttonClass String An optional class fragment for the button.
opt_tooltip String An optional tooltip for the button.

Methods


actionPerformed(currentValue, done)

This method is called when the user invoked attribute editing action. It is intended to show a more specific editing interface for a given URL: e.g. a color picker, an image chooser, etc.
Parameters:
Name Type Description
currentValue string The current value of the attribute.
done function The function to be invoked with the edited value. The first parameter is the new value of the attribute. The behaviour of the "done" callback is the following:
  • If the argument is the same as the current value, nothing happens.
  • If the argument is null, the attribute will be deleted.
  • If the argument is a string, different than the current value, the value will be updated.
The second parameter is a flag that, when set to true, will try to consider the value of the first parameter as an URL and try to make it relative to the XML base url before updating the document.

getButtonClass()

Renders a small icon for the action.
Returns:
The URL of the small icon HTML element that corresponds to the small icon.
Type
string

getTooltip()

Returns the tooltip on the button
Returns:
The optional tooltip for the button.
Type
string