cl2dlope / distal Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/distal
Automatically exported from code.google.com/p/distal
Using qtext when value might be a zero requires a workaround since distal
assumes the value to be non-existent and hides element instead of showing it
with a zero.
Example:
{items: []}
<div data-qtext="items.length"></div>
Result: <div> is hidden
Expected result: <div>0</div>
Original issue reported on code.google.com by [email protected]
on 24 Sep 2012 at 12:02
<table data-qrepeat="m list">...</table>
The above code did not work in Opera.
This bug is fixed in r127.
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 5:14
I apologize in advance since this is kindof vague and unfair. But is there
anyway to improve performance? Distal looks simple and promising but based on
comparative template solutions this is extremely slow.
Take a look at
http://jsperf.com/transparency-vs-weld-vs-mustache/10
and
http://jsperf.com/transparency-vs-handlebars-finite-list/4
to see what I mean.
Perhaps you can precompile the template or cache it or something along those
lines for reuse.
Also- And this is really off topic and even more unfair.. I am big fan of SVN
and all, but github just has so much more exposure for open-source projects
like this, and allows for forks, and pull-requests, etc. Also, they have
hosting which means your nice documentation can also look nice.
Original issue reported on code.google.com by [email protected]
on 28 Mar 2012 at 5:37
I am looking for a way to manipulate the data for an element in the
distal.beforeText() callback but is unable to do so.
I suspect this to be because the arguments to the callback is passed as value
and not by reference.
Please let me know if there's any to achieve what I want, in another way.
best regards.
Original issue reported on code.google.com by [email protected]
on 20 Mar 2012 at 3:51
The current behaviour of cloning elements containing data-qrepeat is simple and
great, however, it has some drawbacks:
Some UI toolkits such as jQuery Mobile modify the DOM after it has been loaded.
Sometimes they modify the structure so hard, that Distal cannot find it's
data-qrepeat element again, if the app wants to apply distal() on a list a
second time.
Example: I have an unordered list of jQuery Mobile checkboxes:
<ul id="mylist">
<li data-qrepeat="e myelements">
<label data-qtext="e.name"><input type="checkbox></label>
</li>
</ul>
When I run $("#mylist").distal(json) for the first time, everything is fine: at
first, Distal expands the DOM, then jQuery Mobile runs its hooks to modify the
DOM structure to turn the <label> and <input> elements into a series of spans
and divs that make the checkboxes look good.
However, now we no longer have the "template" DOM element to run Distal again,
because jQuery removes the <label data-qtext="e.name"> and replaces it with
another element (or rather, it moves the <label> somewhere down below).
Since we are on a single page app, it is likely that we want to update the list
a second time, eg. to display new results. But we can not.
The problem I see here is that Distal modifies the repeating element
_in-place_. IMHO the element containing data-qrepeat should not be touched. It
should be used as a template. The problem could be solved like this:
Whenever Distal encounters a data-repeat attribute, it clones the element the
given number of times and sets the data-qdup attribute on all clones. Second,
it sets the original template element to display:none! Later on, when Distal is
run again on the same template element, it removes all qdup children (which it
does anyway right now) and clones the original template again.
By using this technique you'll still have the TAL benefits, such as, that the
HTML contains the full template text and can be edited by authoring tools such
as DreamWeaver. And my proposal doesn't break backward compatibility; existing
templates continue to work.
What do you think?
Original issue reported on code.google.com by [email protected]
on 25 Sep 2013 at 11:44
Hey, small issue. When using qtext on a button it changes the value attribute
instead of innerHTML. While buttons can be used to pass values I don't think
it's the expected outcome of qtext.
Example:
<button qtext="anything">Text</button>
becomes
<button value="anything">Text</button>
resulting in a button with the text "Text" on it and not "anything" as I
would've expected.
Workaround is to use "html anything".
Original issue reported on code.google.com by [email protected]
on 11 Sep 2012 at 6:56
I have a loop within an array and I'd like to obtain:
...
<input type="checkbox" ... /><label ...>...</label>
<input type="checkbox" ... /><label ...>...</label>
...
As data-qrepeat should be attached to a tag I need an enclosing one, but this
leads to:
...
<div ...>
<input type="checkbox" ... /><label ...>...</label>
</div>
<div ...>
<input type="checkbox" ... /><label ...>...</label>
</div>
...
is there any way to achieve it?
A good solution would be an additional feature to hide a tag, leaving its
content like:
<div data-qrepeat="m keywords" data-qmode="content">...</div>
where data-qmode could be "full" (default) to set tag and its content,
"content" to set only content (tag will disappear in generated content).
Original issue reported on code.google.com by [email protected]
on 1 Apr 2012 at 5:38
qtext does not change innerHTML of labels. I suspect for the same reason as
<button> didn't work previously. Putting "html" in front of variable name works.
{var: "works"}
<label data-qtext="var"></label>
<label data-qtext="html var">works</label>
Original issue reported on code.google.com by [email protected]
on 10 Oct 2012 at 11:26
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.