Export to GitHub

css-template-layout - issue #10

when html structure do not contain template but has css with template definition, el.slot errors out


Posted on May 24, 2011 by Grumpy Bird

What steps will reproduce the problem? 1. Add html with no template struct 2. Add a css or style with any template definitions but none used in the html 3. Run the sample

What is the expected output? What do you see instead? slot.el is undefined error source line: [Break On This Error] if(!slot.el.parents().is(tpl_sel) && !slot.el.is(tpl_sel)) {

What version of the product are you using? On what operating system? 1.1.6

Please provide any additional information below. Issue is in getTemplateData(rules) .. var parents = $(p_sel).parents(); will return nothing because no template exist for this definition leading to cur_sel = false in the code below

// Get first template or nearest one if(min_distance === false || distance < min_distance) { min_distance = distance; cur_sel = t_sel; }

Comment #1

Posted on May 25, 2011 by Grumpy Bird

I fixed the issue so thought i contribute it here. Changes are on line 542, return nothing(empty object) if template isn't found in the html and line 1243 - if template returned is an empty object, then template wasn't found in html, thus no need to call t.make() else call t.make(). Attach is the update file.

Attachments

Status: New

Labels:
Type-Defect Priority-Medium