FLUID-5181: UI Options component should support top-level options for template and message prefixes

Metadata

Source
FLUID-5181
Type
Bug
Priority
Blocker
Status
Closed
Resolution
Fixed
Assignee
N/A
Reporter
Anastasia Cheetham
Created
2013-10-17T15:30:02.762-0400
Updated
2013-10-28T10:32:52.288-0400
Versions
N/A
Fixed Versions
  1. 1.5
Component
  1. Prefs Framework
  2. UI Options

Description

It is highly likely that someone using the UI Options component will need to specify the relative path to the templates and message files. Currently, the UI Options component itself does not offer these as top-level options; It can be accomplished using a distributeOptions block as shown below:

fluid.uiOptions.prefsEditor(".flc-prefsEditor-separatedPanel", {
    distributeOptions: [{
        source: "{that}.options.templatePath",
        target: "{that prefsEditorLoader}.options.templatePrefix"
    }, {
        source: "{that}.options.messagePath",
        target: "{that prefsEditorLoader}.options.messagePrefix"
    }],
    templatePath: "../../framework/preferences/html/",
    messagePath: "../../framework/preferences/messages/"
});

This expects too much of the UI Options component integrator; the whole point of this component is to give an integrator a super-simple way to get the starter panels.

A preferable API would be:

fluid.uiOptions.prefsEditor(".flc-prefsEditor-separatedPanel", {
    templatePath: "../../framework/preferences/html/",
    messagePath: "../../framework/preferences/messages/"
});

i.e. the options distribution should be taken care of by the component itself, somehow.

Comments