| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2,7 +2,7 @@ var Hammer = require('../../../module/hammer'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					var Item = require('./Item'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @constructor ItemRange | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @constructor RangeItem | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @extends Item | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @param {Object} data             Object containing parameters start, end | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 *                                  content, className. | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -11,7 +11,7 @@ var Item = require('./Item'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @param {Object} [options]        Configuration options | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 *                                  // TODO: describe options
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					function ItemRange (data, conversion, options) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					function RangeItem (data, conversion, options) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  this.props = { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    content: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      width: 0 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -32,16 +32,16 @@ function ItemRange (data, conversion, options) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  Item.call(this, data, conversion, options); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype = new Item (null, null, null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype = new Item (null, null, null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.baseClassName = 'item range'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.baseClassName = 'item range'; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Check whether this item is visible inside given range | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @returns {{start: Number, end: Number}} range with a timestamp for start and end | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @returns {boolean} True if visible | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.isVisible = function(range) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.isVisible = function(range) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  // determine visibility
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  return (this.data.start < range.end) && (this.data.end > range.start); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					}; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -49,7 +49,7 @@ ItemRange.prototype.isVisible = function(range) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Repaint the item | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.redraw = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.redraw = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  var dom = this.dom; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (!dom) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // create DOM
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -117,7 +117,7 @@ ItemRange.prototype.redraw = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Show the item in the DOM (when not already visible). The items DOM will | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * be created when needed. | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.show = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.show = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (!this.displayed) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.redraw(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -127,7 +127,7 @@ ItemRange.prototype.show = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Hide the item from the DOM (when visible) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @return {Boolean} changed | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.hide = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.hide = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (this.displayed) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    var box = this.dom.box; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -146,7 +146,7 @@ ItemRange.prototype.hide = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Reposition the item horizontally | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.repositionX = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.repositionX = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  var parentWidth = this.parent.width; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  var start = this.conversion.toScreen(this.data.start); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  var end = this.conversion.toScreen(this.data.end); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -217,7 +217,7 @@ ItemRange.prototype.repositionX = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Reposition the item vertically | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype.repositionY = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype.repositionY = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  var orientation = this.options.orientation, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      box = this.dom.box; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -233,7 +233,7 @@ ItemRange.prototype.repositionY = function() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Repaint a drag area on the left side of the range when the range is selected | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @protected | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype._repaintDragLeft = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype._repaintDragLeft = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (this.selected && this.options.editable.updateTime && !this.dom.dragLeft) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // create and show drag area
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    var dragLeft = document.createElement('div'); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -263,7 +263,7 @@ ItemRange.prototype._repaintDragLeft = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * Repaint a drag area on the right side of the range when the range is selected | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @protected | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					ItemRange.prototype._repaintDragRight = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					RangeItem.prototype._repaintDragRight = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  if (this.selected && this.options.editable.updateTime && !this.dom.dragRight) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // create and show drag area
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    var dragRight = document.createElement('div'); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -289,4 +289,4 @@ ItemRange.prototype._repaintDragRight = function () { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					}; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					module.exports = ItemRange; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					module.exports = RangeItem; |