Skip to content
Browse files

Support disabling dragging.

  • Loading branch information...
1 parent 4c63ac9 commit ab8f73c46de72ab112d74d5e228acc384f343a38 Alexander Staubo committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 jquery_collection_view.js
View
3 jquery_collection_view.js
@@ -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';
@@ -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) {

0 comments on commit ab8f73c

Please sign in to comment.
Something went wrong with that request. Please try again.