rsence-pre 2.2.0.22 → 2.2.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0.22.pre
1
+ 2.2.0.23.pre
@@ -46,6 +46,8 @@ HTimeSheet = HControl.extend({
46
46
  itemOffsetTop: 20, // Theme settings; don't enter in options
47
47
  itemOffsetBottom: 0, // Theme settings; don't enter in options
48
48
  itemDisplayTime: true,
49
+ allowClickCreate: false,
50
+ minDragSize: 5, // minimum amount of pixels dragged required for accepting a drag
49
51
  hourOffsetTop: -4, // Theme settings; don't enter in options
50
52
  constructor: function( _ctrl ){
51
53
  if( this.defaultLabel === undefined ){
@@ -292,6 +294,7 @@ HTimeSheet = HControl.extend({
292
294
 
293
295
  // drag & drop event listeners, used for dragging new timesheet items
294
296
  startDrag: function( x, y, b ){
297
+ this._startDragY = y;
295
298
  this.startDragTime = this.pxToTime( y-this.pageY() );
296
299
  this.refreshDragPreview( this.startDragTime, this.startDragTime + this.minDuration );
297
300
  this.dragPreview.bringToFront();
@@ -318,17 +321,21 @@ HTimeSheet = HControl.extend({
318
321
 
319
322
  endDrag: function( x, y, b ){
320
323
  var
321
- _dragTime = this.pxToTime( y-this.pageY() );
322
- if( _dragTime !== this.startDragTime ){
324
+ _dragTime = this.pxToTime( y-this.pageY() ),
325
+ _minDistanceSatisfied = Math.abs( this._startDragY - y ) >= this.options.minDragSize;
326
+ if( this.options.allowClickCreate ){
327
+ _minDistanceSatisfied = true;
328
+ }
329
+ this.dragPreview.hide();
330
+ if( _dragTime !== this.startDragTime && _minDistanceSatisfied ){
323
331
  if( this.activateEditor( this.dragPreview ) ){
324
332
  this.editor.createItem( HVM.clone( this.dragPreview.value ) );
325
333
  return true;
326
334
  }
335
+ this.clickCreated = false;
336
+ this.startDragTime = false;
337
+ this.click( x, y, b );
327
338
  }
328
- this.clickCreated = false;
329
- this.dragPreview.hide();
330
- this.startDragTime = false;
331
- this.click( x, y, b );
332
339
  return false;
333
340
  },
334
341
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- hash: 83
4
+ hash: 81
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
9
  - 0
10
- - 22
11
- version: 2.2.0.22
10
+ - 23
11
+ version: 2.2.0.23
12
12
  platform: ruby
13
13
  authors:
14
14
  - Riassence Inc.
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-09-07 00:00:00 Z
20
+ date: 2011-09-23 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rsence-deps