prometheus/promdash — pull request #12 by stuartnelson3 (2013-12-16 19:51:39+00:00)
Title: add support for drag n drop graphs

Couple things to note:

1. dragging and dropping isn't perfect. a lot of times i have to drag from the left most position over to the right, wiggle it a bit, and drop it after the right side graph takes its place. you'll see when you test it out.
2. i chose to add just the sortable module as a file in the project instead of all of angular-ui from a cdn. not sure how you feel about this. plus side is we're loading less, but it's an extra file in the project. i'm not 100% convinced this is better, since loads from the cdn would get cached after the first load anyway. up to you (i'm not sure how many people are using promdash or if it's still just SC internal).
3. i added a callback to save every time the graphs get re-ordered. it seemed to make sense to me.
4. in adding the sorting, i changed the containing div to a `

` and each div containing a graph to an `
`, so I added some css to get back to how it looked when it was using divs. I haven't tried using divs instead of li's, so if you prefer that markup i can change it back and see how it goes.

lastly, angular sortable requires jquery-ui, so i snagged that from the google cdn.