Forráskód Böngészése

handlers for seg touching, isSimulatingTouch

Adam Shaw 10 éve
szülő
commit
a8f3818429
2 módosított fájl, 18 hozzáadás és 3 törlés
  1. 12 3
      src/common/Grid.events.js
  2. 6 0
      src/main.js

+ 12 - 3
src/common/Grid.events.js

@@ -175,9 +175,14 @@ Grid.mixin({
 	// Attaches event-element-related handlers to the container element and leverage bubbling
 	// Attaches event-element-related handlers to the container element and leverage bubbling
 	bindSegHandlers: function() {
 	bindSegHandlers: function() {
 		this.bindSegHandler('click', this.handleSegClick);
 		this.bindSegHandler('click', this.handleSegClick);
-		this.bindSegHandler('mouseenter', this.handleSegMouseover);
-		this.bindSegHandler('mouseleave', this.handleSegMouseout);
-		this.bindSegHandler('mousedown', this.handleSegMousedown);
+
+		if (!FC.isSimulatingTouch) {
+			this.bindSegHandler('mouseenter', this.handleSegMouseover);
+			this.bindSegHandler('mouseleave', this.handleSegMouseout);
+			this.bindSegHandler('mousedown', this.handleSegMousedown);
+		}
+
+		this.bindSegHandler(FC.touchstart, this.handleSegTouchStart);
 	},
 	},
 
 
 
 
@@ -234,6 +239,10 @@ Grid.mixin({
 	},
 	},
 
 
 
 
+	handleSegTouchStart: function(seg, ev) {
+	},
+
+
 	/* Event Dragging
 	/* Event Dragging
 	------------------------------------------------------------------------------------------------------------------*/
 	------------------------------------------------------------------------------------------------------------------*/
 
 

+ 6 - 0
src/main.js

@@ -6,6 +6,12 @@ var FC = $.fullCalendar = {
 var fcViews = FC.views = {};
 var fcViews = FC.views = {};
 
 
 
 
+// touch
+FC.isSimulatingTouch = false;
+FC.touchstart = FC.isSimulatingTouch ? 'mousedown' : 'touchstart';
+FC.touchend = FC.isSimulatingTouch ? 'mouseup' : 'touchend';
+
+
 $.fn.fullCalendar = function(options) {
 $.fn.fullCalendar = function(options) {
 	var args = Array.prototype.slice.call(arguments, 1); // for a possible method call
 	var args = Array.prototype.slice.call(arguments, 1); // for a possible method call
 	var res = this; // what this function will return (this jQuery object by default)
 	var res = this; // what this function will return (this jQuery object by default)