Your module is not returning anything and init is invisible outside the 
module's function. After the init function add this...

                return {
                init : init
        };

The rest looks fine, assuming that you've checked that threedots is AMD 
compliant. if it isn't then you'll have to shim it (search the mailing list for 
contributeModuleManager).

Cheers,
Geoff


On 27 Nov 2014, at 10:35 pm, Jan Fryblik <jan.fryb...@ebrothers.cz> wrote:

> 
> 
> Hello guys,
> 
> I'm fighting a bit with RequireJS modules. So...
> 
> I have Tapestry library 'cms' with 'LastArticle' component. So I have simple 
> RequireJS module in 
> resources/META-INF/modules/cms folder with following code
> 
> define(["jquery", "t5/core/dom", "jquery/jquery.threedots.min"], function ($, 
> dom)
> {
> init = function (rowsCount)
> {
> $('.preview').ThreeDots({ max_rows: rowsCount });
> }
> });
> 
> and in LastArticle.java I call:
> 
> scriptSupport.require("LastArticle").invoke("init").with(previewLinesCount);
> 
> in SetupRender method.
> 
> In javascript console then I can see error "TypeError: moduleLib is 
> undefined". So either I still don't fully understand this concept or I've 
> missed something. Could you please help me? Thanks a lot in advance!
> 
> Best,
> Jan

Reply via email to