Skip to content

Commit

Permalink
Merge remote-tracking branch 'justin/FLUID-5474-1.5.1' into infusion-…
Browse files Browse the repository at this point in the history
…1.5.x

* justin/FLUID-5474-1.5.1:
  FLUID-5474: No longer removing tocTemplate option Distribute options had been moving the tocTemplate option, as opposed to copying it. The result of which was that the iframeEnhancer was looking for the option in a place it had been removed from. Also added tests to verify that the tocTemplate is being passed to the iframeEnhancer.
  • Loading branch information
cindyli committed Jul 17, 2014
2 parents 3779908 + f6fe038 commit 41b9a82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/uiOptions/js/UIOptions.js
Expand Up @@ -22,16 +22,14 @@ var fluid_1_5 = fluid_1_5 || {};
gradeNames: ["fluid.prefs.constructed.prefsEditor", "autoInit"],
distributeOptions: {
source: "{that}.options.tocTemplate",
removeSource: true,
target: "{that uiEnhancer}.options.tocTemplate"
},
enhancer: {
distributeOptions: {
source: "{that}.options.tocTemplate",
removeSource: true,
target: "{that > fluid.prefs.enactor.tableOfContents}.options.tocTemplate"
}
}
});

})(jQuery, fluid_1_5);
5 changes: 3 additions & 2 deletions src/tests/component-tests/uiOptions/js/UIOptionsTests.js
Expand Up @@ -21,15 +21,16 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
jqUnit.module("UIOptions Tests");

jqUnit.asyncTest("Pass in customized toc template", function () {
jqUnit.expect(1);
jqUnit.expect(2);

var customizedTocTemplate = "../../../../components/tableOfContents/html/TableOfContents.html";

fluid.uiOptions.prefsEditor(".flc-prefsEditor-separatedPanel", {
tocTemplate: customizedTocTemplate,
listeners: {
onReady: function (that) {
jqUnit.assertEquals("The toc template is applied properly", customizedTocTemplate, that.enhancer.uiEnhancer.fluid_prefs_enactor_tableOfContents.options.tocTemplate);
jqUnit.assertEquals("The toc template is applied properly to the pageEnhancer", customizedTocTemplate, that.enhancer.uiEnhancer.fluid_prefs_enactor_tableOfContents.options.tocTemplate);
jqUnit.assertEquals("FLUID-5474: The toc template is applied properly to iframeEnhancer", customizedTocTemplate, that.prefsEditorLoader.iframeRenderer.iframeEnhancer.fluid_prefs_enactor_tableOfContents.options.tocTemplate);
jqUnit.start();
}
},
Expand Down

0 comments on commit 41b9a82

Please sign in to comment.