Body: <p>I'm using formattingAdd in a JSON config file for redactor. The items do not appear in the menu in the order I define them.</p>
  
  <p>After some searching I realise the format for formattingAdd is an object and each format is a property of that object. Javascript does not guarantee the order of properties returned from an object.</p>
  
  <p>The redactor source code uses jQuery $.each which cannot 'fix' the issue with javascript not ordering the properties of an object.</p>
  
  <p>Does anyone have a workaround for this? I could change the code in craft/app/resources/lib/redactor/redactor.js to accept an array of objects for formattingAdd but I guess it would be overwritten everytime I upgrade craft.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-31T09:41:33.320Z
Comments.Text: I am curious, using which browser do you experience this?
Comments.UserDisplayName: carlcs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-05T10:31:08.457Z
Comments.Text: Safari on Mac, also tested on Chrome and it behaves in the same way.
Comments.UserDisplayName: TC0072
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-24T14:46:37.403Z
Comments.Text: No idea why this was down-voted; I'd love to have a solution to this, too. One of the `formattingAdd` options I'm adding should be _above_ the H1. :-/
Comments.UserDisplayName: Sandwich
Tags: <redactor>
Title: Order of Redactor format options using formattingAdd
ThreadText: # Order of Redactor format options using formattingAdd
  
  (Asked by: username_0 on 2017-03-31)
  
  I'm using formattingAdd in a JSON config file for redactor. The items do not appear in the menu in the order I define them.
  
  After some searching I realise the format for formattingAdd is an object and each format is a property of that object. Javascript does not guarantee the order of properties returned from an object.
  
  The redactor source code uses jQuery $.each which cannot 'fix' the issue with javascript not ordering the properties of an object.
  
  Does anyone have a workaround for this? I could change the code in craft/app/resources/lib/redactor/redactor.js to accept an array of objects for formattingAdd but I guess it would be overwritten everytime I upgrade craft.
  
  **Tags:** redactor
  
  > **Comments:**
  > **username_1**: I am curious, using which browser do you experience this?  
  > **username_0**: Safari on Mac, also tested on Chrome and it behaves in the same way.  
  > **username_2**: No idea why this was down-voted; I'd love to have a solution to this, too. One of the `formattingAdd` options I'm adding should be _above_ the H1. :-/  
  
  ---
  
  ## 0 answers
  
  