nickdunn/publish_tabs — pull request #13 by vlad-ghita (2012-05-18 12:44:59+00:00)
Title: Fixes a nasty Chrome bug.

Apparently, Chrome 18 on Windows 7 reorders ascending keys in an object (don't know about other versions). This affects publish_tabs because encoded JSON data in current implementation can be sent for eg:

{ 4: 'foo', 5: 'bar', 3: 'baz'}

becomes

{ 3: 'baz', 4: 'foo', 5: 'bar'}

This behavior reflects on the order of publish tabs display. See the [correct order in Firefox][1] and [incorrect order in Chrome][2]. The situation from the example appeared because `Content` tab was added latest, thus having the biggest ID.

This commit solves this issue by using an arbitrary index not related to field id, in ascending order.

[1]: http://dl.dropbox.com/u/13645632/bugs/publish_tabs_firefox_good.png
[2]: http://dl.dropbox.com/u/13645632/bugs/publish_tabs_chrome_bad.png