Ghost/core/client/templates/components/gh-navitem.hbs
Paul Adam Davis 68eb6b67b0 Drag & Drop Navigation Reordering
Closes #4540

- Implements drag & drop to reorder navigation items
- Adds a `sort` property to navigation items
- Adds a tiny library to enable touch events for drag & drop. It hooks onto jQuery UI.
- Sort nav items before being saved
- Adds `settings-view-navigation` to route for body class
2015-02-12 17:02:46 +00:00

25 lines
880 B
Handlebars

{{#unless navItem.last}}
<span class="navigation-item-drag-handle icon-grab">
<span class="hidden">Reorder</span>
</span>
{{/unless}}
<div class="navigation-inputs">
<span class="navigation-item-label">
{{gh-trim-focus-input focus=navItem.last placeholder="Label" value=navItem.label}}
</span>
<span class="navigation-item-url">
{{gh-navitem-url-input baseUrl=baseUrl url=navItem.url change="updateUrl"}}
</span>
</div>
<span class="navigation-item-action">
{{#if navItem.last}}
<button type="button" class="add-navigation-link icon-add" {{action "addItem"}}>
<span class="hidden">Add</span>
</button>
{{else}}
<button type="button" class="navigation-delete icon-trash" {{action "deleteItem" navItem}}>
<span class="hidden">Delete</span>
</button>
{{/if}}
</span>