Skip to content
This repository

Configure undraggable tags in Sortables. #1136

Merged
merged 1 commit into from almost 2 years ago

3 participants

Graham Ashton Arian Stolwijk Darren Waddell
Graham Ashton
gma commented

The input, button, a, textarea, select and option tags aren't draggable
when using Sortables. This patch adds an unDraggableTags option that can
be passed to Sortables to override the above list, allowing you to drag
a container element even when you click on one of the (undraggable)
elements within it.

Graham Ashton gma Configure undraggable tags in Sortables.
The input, button, a, textarea, select and option tags aren't draggable
when using Sortables. This patch adds an unDraggableTags option that can
be passed to Sortables to override the above list, allowing you to drag
a container element even when you click on one of the (undraggable)
elements within it.
225a063
Arian Stolwijk
Owner
arian commented

+1

Darren Waddell fakedarren merged commit de65301 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 28, 2012
Graham Ashton gma Configure undraggable tags in Sortables.
The input, button, a, textarea, select and option tags aren't draggable
when using Sortables. This patch adds an unDraggableTags option that can
be passed to Sortables to override the above list, allowing you to drag
a container element even when you click on one of the (undraggable)
elements within it.
225a063
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 Source/Drag/Sortables.js
5 Source/Drag/Sortables.js
@@ -36,7 +36,8 @@ var Sortables = new Class({
36 36 dragOptions: {}/*<1.2compat>*/,
37 37 snap: 4,
38 38 constrain: false,
39   - preventDefault: false
  39 + preventDefault: false,
  40 + unDraggableTags: ['button', 'input', 'a', 'textarea', 'select', 'option']
40 41 /*</1.2compat>*/
41 42 },
42 43
@@ -148,7 +149,7 @@ var Sortables = new Class({
148 149 if (
149 150 !this.idle ||
150 151 event.rightClick ||
151   - ['button', 'input', 'a', 'textarea', 'select', 'option'].contains(event.target.get('tag'))
  152 + this.options.unDraggableTags.contains(event.target.get('tag'))
152 153 ) return;
153 154
154 155 this.idle = false;

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.