Preserve link order set by application

This commit is contained in:
nathangray 2016-08-17 10:52:45 -06:00
parent 4e793ff426
commit c7996ae42e

View File

@ -108,9 +108,11 @@ class Link extends Etemplate\Widget
$links = Api\Link::query($app, $pattern, $options); $links = Api\Link::query($app, $pattern, $options);
// Add ' ' to key so javascript does not parse it as a number.
// This preserves the order set by the application.
$linksc = array_combine(array_map(function($k) $linksc = array_combine(array_map(function($k)
{ {
return (string)$k; return (string)" ".$k;
}, array_keys($links)), $links); }, array_keys($links)), $links);
$response = Api\Json\Response::get(); $response = Api\Json\Response::get();