Commit ef3cd715 authored by Oleg Korshul's avatar Oleg Korshul

.

parent a28cf742
...@@ -375,6 +375,8 @@ function IScroll (el, options) { ...@@ -375,6 +375,8 @@ function IScroll (el, options) {
this.scrollTo(this.options.startX, this.options.startY); this.scrollTo(this.options.startX, this.options.startY);
this.enable(); this.enable();
this.isDown = false;
} }
IScroll.prototype = { IScroll.prototype = {
...@@ -1632,11 +1634,13 @@ IScroll.prototype = { ...@@ -1632,11 +1634,13 @@ IScroll.prototype = {
step(); step();
}, },
handleEvent: function (e) { handleEvent: function (e) {
switch ( e.type ) { switch ( e.type )
{
case 'touchstart': case 'touchstart':
case 'pointerdown': case 'pointerdown':
case 'MSPointerDown': case 'MSPointerDown':
case 'mousedown': case 'mousedown':
this.isDown = true;
this.eventsElement ? this.manager.mainOnTouchStart(e) : this._start(e); this.eventsElement ? this.manager.mainOnTouchStart(e) : this._start(e);
break; break;
case 'touchmove': case 'touchmove':
...@@ -1653,7 +1657,11 @@ IScroll.prototype = { ...@@ -1653,7 +1657,11 @@ IScroll.prototype = {
case 'pointercancel': case 'pointercancel':
case 'MSPointerCancel': case 'MSPointerCancel':
case 'mousecancel': case 'mousecancel':
this.eventsElement ? this.manager.mainOnTouchEnd(e) : this._end(e); if (this.isDown || e.srcElement == this.eventsElement)
{
this.eventsElement ? this.manager.mainOnTouchEnd(e) : this._end(e);
}
this.isDown = false;
break; break;
case 'orientationchange': case 'orientationchange':
case 'resize': case 'resize':
......
...@@ -492,33 +492,6 @@ ...@@ -492,33 +492,6 @@
this.eventsElement = _id; this.eventsElement = _id;
this.iScroll.eventsElement = this.eventsElement; this.iScroll.eventsElement = this.eventsElement;
this.iScroll._initEvents(); this.iScroll._initEvents();
// затачиваемся на конкретные div в интерфейсе ( потом переделать? )
var _arrayElements = [];
var _testElem = document.getElementById("editor-navbar");
if (_testElem)
_arrayElements.push(_testElem);
_testElem = document.getElementById("cell-editing-box");
if (_testElem)
_arrayElements.push(_testElem);
_testElem = document.getElementsByClassName("statusbar")[0];
if (_testElem)
_arrayElements.push(_testElem);
for (var i = _arrayElements.length - 1; i >= 0; i--)
{
_arrayElements[i].onmousedown = _arrayElements[i]["ontouchstart"] =
_arrayElements[i].onmousemove = _arrayElements[i]["ontouchmove"] =
_arrayElements[i].onmouseup = _arrayElements[i]["ontouchend"] =
_arrayElements[i]["ontouchcancel"] = function(e) { AscCommon.stopEvent(e); };
/*
_arrayElements["onpointerdown"] = _arrayElements["onmspointerdown"] =
_arrayElements["onpointermove"] = _arrayElements["onmspointermove"] =
_arrayElements["onpointerup"] = _arrayElements["onmspointerup"] =
_arrayElements[i]["onpointercancel"] = _arrayElements[i]["onmspointercancel"] = function(e) { AscCommon.stopEvent(e); };
*/
}
}; };
// создание вспомогательного элемента, для прокрутки. по идее потом можно изменить // создание вспомогательного элемента, для прокрутки. по идее потом можно изменить
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment