Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Support disabling dragging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Staubo committed Jul 29, 2011
1 parent 4c63ac9 commit ab8f73c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jquery_collection_view.js
Expand Up @@ -6,6 +6,7 @@ Backbone.JQuery.CollectionView = Backbone.View.extend({
_.bindAll(this, 'render', '_renderOnReorder', '_setupSubviewElement', '_remove', '_add', '_reset');

options = options || {};
this.dragging = typeof options.dragging != 'undefined' ? options.dragging : true;
this.dragTolerance = options.dragTolerance || 10;
this.scrollTolerance = options.scrollTolerance || 40;
this.draggingClass = options.draggingClass || 'dragging';
Expand Down Expand Up @@ -117,7 +118,7 @@ Backbone.JQuery.CollectionView = Backbone.View.extend({
},

_mayDrag: function() {
return this._subviews.length > 1;
return this.dragging && this._subviews.length > 1;
},

_beginDrag: function(event, view) {
Expand Down

0 comments on commit ab8f73c

Please sign in to comment.