From 0b720bbc5fdb6338c22ec42980d7af0e85f988f9 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Sun, 30 Nov 2014 23:49:15 -0800 Subject: [PATCH] Grab handle example --- index.html | 26 +++++++++++++++++++++++++- st/app.css | 7 ++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 1711192..0792d51 100644 --- a/index.html +++ b/index.html @@ -145,6 +145,25 @@ + +
+
+
Drag handle and selectable text
+ +
+
Drag handles
+
    +
  • Select text freely
  • +
  • Drag my handle
  • +
  • Best of both worlds
  • +
+
+ +
+
+
+ +
@@ -346,7 +365,12 @@ var editableList = new Sortable(editable, { animation: 150 }); }); - + + new Sortable(document.getElementById('handle-1'), { + handle: '.drag-handle', + animation: 150 + }); + angular.module('todoApp', ['ng-sortable']) .controller('TodoController', ['$scope', function ($scope) { diff --git a/st/app.css b/st/app.css index 1b53f33..c5b7f89 100644 --- a/st/app.css +++ b/st/app.css @@ -216,7 +216,12 @@ img { padding-bottom: 0; } - +.drag-handle { + margin-right: 0.25em; + color: blue; + cursor: move; + cursor: -webkit-grabbing; /* overrides 'move' */ +} #todos input { padding: 5px;