{"_id":"551447a90edb420d0050016e","parentDoc":null,"project":"54d53c7b23010a0d001aca0c","__v":3,"user":"54cfa8e1a8a4fd0d00b7fd1d","category":{"_id":"54dd1315ca1e5219007e9daa","pages":["54dd1324ca1e5219007e9dac","54e26fe6dd4c990d00479bef","5516e2d97f5d0919007d0701"],"version":"54d5635532d98b0d00384afb","project":"54d53c7b23010a0d001aca0c","__v":3,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-12T20:54:45.914Z","from_sync":false,"order":8,"slug":"user-interface","title":"User Interface"},"version":{"_id":"54d5635532d98b0d00384afb","project":"54d53c7b23010a0d001aca0c","__v":10,"forked_from":"54d53c7c23010a0d001aca0f","createdAt":"2015-02-07T00:59:01.934Z","releaseDate":"2015-02-07T00:59:01.934Z","categories":["54d5635632d98b0d00384afc","54d5635632d98b0d00384afd","54d5635632d98b0d00384afe","54d5635632d98b0d00384aff","54d5635632d98b0d00384b00","54d5635632d98b0d00384b01","54d5635632d98b0d00384b02","54d652097e05890d006f153e","54dd1315ca1e5219007e9daa","54e21e2b22de1c230094b147","54e68e62a43fe13500db3879","54fa1d3fe7a0ba2f00306309","551c453a23a1ee190034d19a","551df586e52a0b23000c62b6","551f39be6886f8230055f02a","55a6720751457325000e4d97"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.1.0","version":"0.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-26T17:53:45.763Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Throughout Cloud9 you'll see APIs that allow you to sort your items using integers. By using an int to set the position it is possible to determine the approximate position of, for instance an item in a menu without having any knowledge about other plugins that are loaded. In most cases there are no special ranges and thus all plugins are a-like. Simply choose a position that makes sense to you and use it. \n\nThese are just some of the places where an index is used to determine the order of elements.\n* [Menus](doc:menus)\n* [Settings and Preferences](doc:settings-and-preferences) \n* [Form](doc:form) \n* [Panels](doc:panel) \n\nTo see what the position numbers are for menus and preferences simply load Cloud9 with `?menus=1` in the url.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/VZbw6TQTZigHT9sq6SkV_2015-03-26_1426.png\",\n        \"2015-03-26_1426.png\",\n        \"1570\",\n        \"932\",\n        \"#64abfb\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"positioning-ui-elements","type":"basic","title":"Positioning UI Elements"}

Positioning UI Elements


Throughout Cloud9 you'll see APIs that allow you to sort your items using integers. By using an int to set the position it is possible to determine the approximate position of, for instance an item in a menu without having any knowledge about other plugins that are loaded. In most cases there are no special ranges and thus all plugins are a-like. Simply choose a position that makes sense to you and use it. These are just some of the places where an index is used to determine the order of elements. * [Menus](doc:menus) * [Settings and Preferences](doc:settings-and-preferences) * [Form](doc:form) * [Panels](doc:panel) To see what the position numbers are for menus and preferences simply load Cloud9 with `?menus=1` in the url. [block:image] { "images": [ { "image": [ "https://files.readme.io/VZbw6TQTZigHT9sq6SkV_2015-03-26_1426.png", "2015-03-26_1426.png", "1570", "932", "#64abfb", "" ] } ] } [/block]