Browse Source

Merge remote-tracking branch 'origin/v4' into v4

flowchartTest
Alex de Mulder 9 years ago
parent
commit
3d4983dcd4
3 changed files with 22 additions and 14 deletions
  1. +8
    -9
      lib/shared/Activator.js
  2. +9
    -0
      lib/timeline/component/css/itemset.css
  3. +5
    -5
      package.json

+ 8
- 9
lib/shared/Activator.js View File

@ -21,20 +21,19 @@ function Activator(container) {
}; };
this.dom.overlay = document.createElement('div'); this.dom.overlay = document.createElement('div');
this.dom.overlay.className = 'overlay';
this.dom.overlay.className = 'vis-overlay';
this.dom.container.appendChild(this.dom.overlay); this.dom.container.appendChild(this.dom.overlay);
this.hammer = Hammer(this.dom.overlay, {prevent_default: false});
this.hammer = Hammer(this.dom.overlay);
this.hammer.on('tap', this._onTapOverlay.bind(this)); this.hammer.on('tap', this._onTapOverlay.bind(this));
// block all touch events (except tap) // block all touch events (except tap)
var me = this; var me = this;
var events = [ var events = [
'touch', 'pinch',
'doubletap', 'hold',
'dragstart', 'drag', 'dragend',
'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
'tap', 'doubletap', 'press',
'pinch',
'pan', 'panstart', 'panmove', 'panend'
]; ];
events.forEach(function (event) { events.forEach(function (event) {
me.hammer.on(event, function (event) { me.hammer.on(event, function (event) {
@ -43,8 +42,8 @@ function Activator(container) {
}); });
// attach a tap event to the window, in order to deactivate when clicking outside the timeline // attach a tap event to the window, in order to deactivate when clicking outside the timeline
this.windowHammer = Hammer(window, {prevent_default: false});
this.windowHammer.on('tap', function (event) {
this.bodyHammer = Hammer(document && document.body, {prevent_default: false});
this.bodyHammer.on('tap', function (event) {
// deactivate when clicked outside the container // deactivate when clicked outside the container
if (!_hasParent(event.target, container)) { if (!_hasParent(event.target, container)) {
me.deactivate(); me.deactivate();
@ -77,7 +76,7 @@ Activator.prototype.destroy = function () {
// cleanup hammer instances // cleanup hammer instances
this.hammer = null; this.hammer = null;
this.windowHammer = null;
this.bodyHammer = null;
// FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory) // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)
}; };

+ 9
- 0
lib/timeline/component/css/itemset.css View File

@ -32,3 +32,12 @@
.vis-foreground .vis-group:last-child { .vis-foreground .vis-group:last-child {
border-bottom: none; border-bottom: none;
} }
.vis-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
}

+ 5
- 5
package.json View File

@ -32,13 +32,13 @@
"hammerjs": "^2.0.4", "hammerjs": "^2.0.4",
"keycharm": "^0.2.0", "keycharm": "^0.2.0",
"moment": "^2.10.2", "moment": "^2.10.2",
"propagating-hammerjs": "^1.4.0"
"propagating-hammerjs": "^1.4.1"
}, },
"devDependencies": { "devDependencies": {
"babel": "^5.1.8",
"babel": "^5.1.11",
"babel-loader": "^5.0.0", "babel-loader": "^5.0.0",
"babelify": "^6.0.2", "babelify": "^6.0.2",
"clean-css": "^3.1.9",
"clean-css": "^3.2.1",
"gulp": "^3.8.11", "gulp": "^3.8.11",
"gulp-concat": "^2.5.2", "gulp-concat": "^2.5.2",
"gulp-minify-css": "^1.0.0", "gulp-minify-css": "^1.0.0",
@ -48,7 +48,7 @@
"mocha": "^2.2.4", "mocha": "^2.2.4",
"rimraf": "^2.3.2", "rimraf": "^2.3.2",
"uglify-js": "^2.4.20", "uglify-js": "^2.4.20",
"webpack": "^1.8.4",
"yargs": "^3.7.1"
"webpack": "^1.8.5",
"yargs": "^3.7.2"
} }
} }

Loading…
Cancel
Save