From a16d307aa9142c44617097133b5c89fbca611ab2 Mon Sep 17 00:00:00 2001 From: Dean Sofer Date: Wed, 30 Jan 2013 02:50:42 -0800 Subject: [PATCH] Added sortable demo --- index.html | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++- js/app.js | 9 ++++++ 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 76a17b5..9c84525 100644 --- a/index.html +++ b/index.html @@ -76,6 +76,7 @@
  • Select2
  • Show / Hide / Toggle
  • TinyMCE
  • +
  • Sortable
  • Currency
  • @@ -967,9 +968,100 @@

    How?

    - +
    + +
    +
    +

    What?

    + +
    +
    +

    Drag and drop the parents and children

    +
    +

    Destroy Families

    +

    You're not fit to be a mother!

    +
      +
    • +
        +
        {{parent.name}}
        +
          +
        • {{child}}
        • +
        +
      +
    • +
    +
    +
    +
    +
    Parents: {{parents|json}}
    +
    +
    +
    +
    +

    How?

    +
    +<script>
    +$scope.parents = [
    +  { name: 'Anna', 
    +    children: ['Alvin', 'Becky' ,'Charlie'] },
    +  { name: 'Barney', 
    +    children: ['Dorothy', 'Eric'] },
    +  { name: 'Chris', 
    +    children: ['Frank', 'Gary', 'Henry'] }
    +];
    +</script>
    +
    +<ul ui-sortable ng-model="parents">
    +  <li ng-repeat="parent in parents">
    +    <h3>{{parent.name}}</h3>
    +    <ul class="children"
    +      ui-sortable="{connectWith:'.children'}"
    +      ng-model="parent.children"> 
    +      <li ng-repeat="child in parent.children">
    +        {{child}}
    +      </li>
    +    </ul>
    +  </li>
    +</ul>
    +
    +
    +
    +
    +
    +
    +
    +

    Static Items

    +
      +
    • First
    • +
    • Second
    • +
    • Third
    • +
    +
    +
    +
    +
    Static Items: {{items|json}}
    +
    +
    +
    +
    +
    +<script>
    +$scope.items = ['One', 'Two', 'Three'];
    +</script>
    +
    +<ul ng-model="items" ui-sortable>
    +  <li>First</li>
    +  <li>Second</li>
    +  <li>Third</li>
    +</ul>
    +
    +
    +
    +