18 April 2014

The Ruby Reflector

Topic

DOM

  Source Favicon
By Loren Segal of gnuu.org 1 month ago.
Email

…EditorView to its associated editor ( getEditor() ) but you cannot get back to the view. Generally in a DOM like arrangement, you should be able to get back to the parent of a child node (especially since these things actually are DOM nodes). Of course, this is absolutely necessary when some events are only emitted with an editor handle and not the view (like atom.project ‘s editor-created event ), because you need the view to actually do anything useful (remember, it's all …

gnuu.org Read
  Source Favicon
By Guest Post of New Relic 1 month ago.
Email

…by actual users. The load time is split into Web Application, Network, DOM Processing and Page Rendering metrics, describing how long the page is taking to access, download and render.

The report showed that average page load times were around 8.5 seconds, way above Akamai's recommended limit of 2 seconds. Also, the time spent on the application and network was negligible. This meant that any optimization efforts we undertook were better focused on improving DOM processing …

newrelic.com Read
  Source Favicon
By Mislav of Mislav's blog 2 months ago.
Email

Fix animate() for elements just added to DOM

Activating CSS transitions for an element just added to the DOM won't work in either Webkit or Mozilla. To work around this, we used to defer setting CSS properties with setTimeout (see 272513b).

This solved the problem for Webkit, but not for latest versions of Firefox. Mozilla seems to need at least 15ms timeout, and even this value varies.

A better solution for both engines is to trigger "layout". This is …

mislav.uniqpath.com Read
  Source Favicon
Email

This solution can hide a bad user experience. We're not making any DOM changes on AJAX success, meaning Capybara can't automatically detect when the AJAX completes. If Capybara can't see it, neither can our users. Depending on your application, this might be OK.

One solution might be to have an AJAX spinner in a standard location that gets shown when AJAX requests start and hidden when AJAX requests complete. To do this globally in jQuery: jQuery.ajaxSetup( …

robots.thoughtbot.com Read
  Source Favicon
On igvita.com 3 months ago.
Email

…other, it also means that the browser can't initiate the font request until it has both the DOM and the CSSOM and is able to resolve which fonts are required for the current page.

In the above example, our external JavaScript blocks DOM construction until it is fetched and executed, which also delays the font download. To fix this, we have a few options at our disposal: (a) eliminate the JavaScript, (b) add an async attribute (if possible), or (c) move it to the bottom of the page. …

igvita.com Read
  Source Favicon
By miraculous1 of mir.aculo.us 3 months ago.
Email

…"small and works well", and it's a good exercise for those JavaScript and DOM muscles to write a small plugin from time to time.

My goal was to have an animated "scroll to top" for the mobile version of Freckle —normally the browser would take care of that (tap status bar to scroll to top), but in a more complex layout the built-in mechanisms for this quickly fail and you'll have to implement some of the interactions users expect (like tap status bar …

mir.aculo.us Read
  Source Favicon
Email

…that Angular provides. ngIf will remove the element from the DOM if its expression evaluates to false. ngInclude replaces its contents with the template at whatever URL its expression evaluates to.

Angular directives are small reusable snippets of HTML with some logic attached to them. Often times they simply exist to compose the built-in directives provided by Angular, which are incredibly powerful. Combined with Angular's bindings, they allow us to manipulate …

robots.thoughtbot.com Read
  Source Favicon
By David of Signal vs. Noise 4 months ago.
Email

The majority of Ajax operations in Basecamp are handled with Server-generated JavaScript Responses ( SJR). It works like this:

Form is submitted via a XMLHttpRequest-powered form.

Server creates or updates a model object.

Server generates a JavaScript view that includes the updated template for the model.

Client evaluates the JavaScript returned by the server, which then updates the DOM .

This simple pattern has a number of key benefits.

Benefit #1: Reuse templates without sacrificing performance

37signals.com Read
  Source Favicon
By miraculous1 of mir.aculo.us 4 months ago.
Email

Cleanup .data() values on DOM element removal with .remove/empty()

.data() now assumes that numbers that begin with zeroes are strings

.removeData() (no argument) now removes all data on the element

Enable reading data-* attributes that have underscores in the name

Other updates

Support simple DOM property names in .prop(name) such as for , class , readonly ...

Implement the .scrollLeft([value]) method

Support setting .scrollTop(value)

Fix $(document).width/height() …

mir.aculo.us Read
  Source Favicon
By Assaf Arkin of Labnotes 5 months ago.
Email

…Introduction To DOM Events . Your periodic refresher on how the DOM works.

Startup Life

The Startup Pitch Deck Template . Spot on! Time to redo out pitch deck. Also, first presentation I've seen made with Bunkr .

Recruiting Advice No One Tells You . A great story about hustling to land a dream job.

None of the Above

Everything You Need To Know About Make-A-Wish Foundation's Adorable, Crime-Fighting Batkid

What …

blog.labnotes.org Read