Questions tagged [twitter-flight]

Flight is a lightweight, component-based JavaScript framework that maps behavior to DOM nodes. Twitter uses it for their web applications.

According to its repository README, Flight is no longer under active development:

Flight is not under active development. New pull requests will not be accepted unless they fix core bugs or security issues.

23 questions
14
votes
0 answers

When to use Twitter's Flight Framework?

Twitter released their Javascript Framework Flight some days ago on github. From what I have gathered, Flight puts the JS logic behind another layer, where the separate components can only be accessed via specific event calls (like an API?). I'm not…
Christian Macht
  • 456
  • 4
  • 20
6
votes
1 answer

Testing the handling of a custom event in Jasmine

I am wanting to ensure that a object's method gets called as an event handler, when a custom jQuery event is triggered; but the unit test is seemingly returning a false-negative, as my implementation works well. (This is part of a test suite that…
joecritch
  • 1,095
  • 2
  • 10
  • 25
5
votes
1 answer

Can I combine Twitter Flight with AngularJS?

A couple of hours ago Twitter released Flight, a component-based framework for JavaScript. Its components are plain DOM elements and communicate through plain DOM events, which its really nice. I just wonder... can I combine this with AngularJS? If…
Pipo
  • 5,623
  • 7
  • 36
  • 46
4
votes
2 answers

Is a component bound to just one element?

I'm trying to wrap my head around Twitter flight. Lets say I have a Program page, it has 16 elements dealing with managing a program, CRUD operations, AJAX requests etc... Using twitter flight, do i need to create a component for each and every node…
Snow_Mac
  • 5,727
  • 17
  • 54
  • 80
2
votes
3 answers

Attach component to dynamically created elements with Twitter Flight

Been looking to figure out how with Twitter Flight can attach to dynamic created elements. Having the following HTML
Add element
And the following component definition var Article = flight.component(function () { …
Johann
  • 137
  • 1
  • 9
1
vote
1 answer

Scroll Event Causes Custom Event To Trigger Twice (should be once)

Following function has the scroll event attached, which then triggers the custom event defined on line 5. Line 5 seems to be causing the function to invoke twice (if removed line 4 is printed once, with line 5 its twice). Custom event should only…
Jamie White
  • 1,560
  • 3
  • 22
  • 48
1
vote
1 answer

Should Flight.js component instances make use of shared variables?

I am just getting started with Flight.js and realized that component instances share local variables, but didn't find anything about it in the documentation. This is what i mean: flight.component(function () { var sharedBetweenAllInstances =…
Rudi
  • 2,987
  • 1
  • 12
  • 18
1
vote
1 answer

FlightJs event propagation

Here is a piece of index.html:
I have attachd two flightJS components to that structure. One for top element: function top() { this.after('initialize', function () { …
Adrian Baran
  • 885
  • 7
  • 23
1
vote
1 answer

Get delegated target for flight component event

Flight has a great eventing system, and makes it easy to setup event handlers for component nodes. However, a couple things eluded me when trying to respond to delegated events for nodes that contained dynamic elements. Here's the situation:
David Atchley
  • 1,204
  • 8
  • 10
1
vote
1 answer

Safari issue with text inputs, text is selected as user enters it causing text to be lost

I have the following input element on my page: I have a Twitter Flight event listener on this element that looks like this: this.on('keyup', { …
1
vote
1 answer

Initializing Google Maps as an AMD module

To initialize google.maps as an AMD module, compliant with twitter/flight and requirejs, use: define([ 'components/flight/lib/component', 'async!http://maps.google.com/maps/api/js?key=AIzaSyDp9D9Db1CWfeGUJ1bin45s2WKZN5sapuM&sensor=false' ],…
HighFlyingFantasy
  • 3,789
  • 2
  • 26
  • 38
0
votes
1 answer

Expose function variables, locally, within component

I have a flightJS component (don't start) and need a way to expose the translated text from bindTranslations after my component has been initialized so that local functions can access the translated values. This is pseudo code of how I would like it…
jsldnppl
  • 915
  • 1
  • 9
  • 28
0
votes
1 answer

Incorrect flow of events using FlightJS

I am trying to figure out an issue where a specific div is showing up before an event being fired, specified by FlightJs functions. define([ 'flight', 'mixins/form' ], function(flight, formMixin) { function forgotPasswordForm() { …
shanwar
  • 319
  • 1
  • 2
  • 19
0
votes
0 answers

Testing Twitter Flight Component with Jasmine

Having issues running Jasmine Test with Twitter Flight. I'm using the jasmine-flight Plugin. Error(s) Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. TypeError: this.Component is not a…
Jamie White
  • 1,560
  • 3
  • 22
  • 48
0
votes
1 answer

Should a flight.js component wait for document.ready?

jQuery suggests to wait for the document ready event before doing any DOM manipulation. In flight.js components, this.after('initialize') seems to be called before that event triggers. Is it necessary to wait for it within a flight component, like…
Rudi
  • 2,987
  • 1
  • 12
  • 18
1
2