anutron / behavior Goto Github PK
View Code? Open in Web Editor NEWAuto-instantiates widgets/classes based on parsed, declarative HTML.
License: MIT License
Auto-instantiates widgets/classes based on parsed, declarative HTML.
License: MIT License
Hi,
I have a span element on my page ... test,
i need to addEvent to pay attention this element, so in my mootool js is kind of like this
var mytest = $('test')
test.addEvent('click', function (e, el) {
.... do something
};
whenever i click the , it will do something ...
on my html ... sometimes i need to toggle to remove that and show that
As what i know ... once i remove that , the event tracking is gone ... i think that's the purpose to avoid memory leak, correct?
But in my case, i kind of need to keep that event tracking even though the is gone ... any suggestion? any options in the mootool addEvent to keep it alive?
hongclub
Hi Aaron,
will you accept a patch with MooTools 1.3-only compatible syntax?
Hello,
The three links in the readme.md are broken, leads to a Github 404 page.
Tibor
See the following example
works fine with Chrome but not in FF.
Tested in FF 13.0.1, FF. 12.x, FF 9.x
Hey
I wondered if it would be possible to cancel the error catcher behavior applies. I'm having 2 major issues with it:
actually no JSON did get past it... even the example from the docu1 won't work :/
"{opt1: 'foo', opt2: 'bar', selector: '.selector'}",
"{opt1: true, opt2: false}",
'{opt1: "foo", opt2: "bar"}'
Hey
So, I've been using Behavior quite heavily for the last few months (and having great fun at it :) ), and I've come across one issue a few times -
There are cases where one filter needs to use some functionality that is created by another. So far I've used several ways to work around it. Usually all my Classes have a load event of some sort, so I can check for it and use it, but what I could really use is a way to specify filter order (right now filters are using for-in loops - which don't have a specific order on all browsers, and I've noticed some inconsistent behavior on FF as well).
I haven't created a pull request because I think this is something that would require some change to the inner architecture, but I have several ideas for this.
Is it something you might implement or should I create my own implementation for this?
I tried using Behaviors in our system, but ran into a conflict with out history manager:
http://plugins.jquery.com/project/history-js
history.js has in its amplify.store.js file a section that begins
if ( div.addBehavior ) {
div.addBehavior( "#default#userdata" );
It appears to be related to compatibility for non-standard IE--it seems that addBehavior was the name of a method in some older version of IE's js, or something, and that the compatibility code in history-js is causing a conflict. If that addBehavior method was ever widely used, you could run into other conflicts as well.
The BehaviorAPI._getOptions method uses:
if (options && options[0] != '{') options = '{' + options + '}';
In IE 8/9, 'myString'[0] returns undefined, instead of the expected 'm'.
I suggest not using IE of course, but for those who must, changing the subject line to:
if (options && options.substring(0,1) != '{') options = '{' + options + '}';
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.