VP-291: Demands blocks for components should be refactored in order to be configurable

Metadata

Source
VP-291
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Alexey Novak
Reporter
Alexey Novak
Created
2013-03-15T13:33:08.796-0400
Updated
2013-03-18T12:56:08.382-0400
Versions
N/A
Fixed Versions
  1. 0.2
Component
  1. core

Description

There are couple of demands blocks in the VideoPlayer code which make options non-configurable for some of the components. In particular options block for the "captionControls" component. Any extra options written in the test for this component would be overwritten by captionControlsOptions specified in the demands block.

fluid.demands("captionControls", ["fluid.browser.nativeVideoSupport"], {
        funcName: "fluid.videoPlayer.languageControls",
        args: ["{controllers}.dom.captionControlsContainer", captionControlsOptions]
    });

Moreover, initial captionControls options and captionControlsOptions should be modified to eliminate an infinite loop with a new way of declaring demands block. This infinite loop is caused by merging captionControls listener onReady attached to onCaptionControlsReady.

captionControls: {
                type: "fluid.emptyEventedSubcomponent",
...
                options: {
                    listeners: {
                        onReady: "{controllers}.events.onCaptionControlsReady"
                    }
                }
            },

and captionControlsOptions event onReady which is attached to onCaptionControlsReady

var captionControlsOptions = {
...
        events: {
...
            onReady: "{controllers}.events.onCaptionControlsReady"
        },
...
    };

Yura sent an e-mail to the fluid-work list today about this behaviour of demands blocks.
http://old.nabble.com/Demands-block-observation-to35179556.html

Comments