Skip to content

Commit

Permalink
Balloon transition cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Sep 25, 2013
1 parent 6111783 commit dcc7c46
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
45 changes: 21 additions & 24 deletions Source/Widgets/Balloon/Balloon.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
.cesium-balloon-container {
visibility: hidden;
opacity: 0;
transition: visibility 0s 0.2s, opacity 0.2s ease-in;
-webkit-transition: visibility 0s 0.2s, opacity 0.2s ease-in;
-moz-transition: visibility 0s 0.2s, opacity 0.2s ease-in;
}

.cesium-balloon-container-visible {
visibility: visible;
opacity: 1;
transition: opacity 0.2s ease-out;
-webkit-transition: opacity 0.2s ease-out;
-moz-transition: opacity 0.2s ease-out;
}

.cesium-balloon-wrapper {
position: absolute;
font-size: 10pt;
Expand All @@ -20,6 +36,11 @@
position: absolute;
overflow: hidden;
z-index: 2;
visibility: hidden;
}

.cesium-balloon-arrow-container-show {
visibility: visible;
}

.cesium-balloon-arrow-container-downup {
Expand Down Expand Up @@ -64,30 +85,6 @@
margin-top: 5px;
}

.cesium-balloon-wrapper-visible {
visibility: visible;
opacity: 1;
transition: opacity 0.2s linear;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
}

.cesium-balloon-wrapper-hidden {
visibility: hidden;
opacity: 0;
transition: visibility 0s 0.2s, opacity 0.2s linear;
-webkit-transition: visibility 0s 0.2s, opacity 0.2s linear;
-moz-transition: visibility 0s 0.2s, opacity 0.2s linear;
}

.cesium-balloon-arrow-show {
visibility: visible;
}

.cesium-balloon-arrow-hide {
visibility: hidden;
}

.cesium-balloon-close {
position: absolute;
top: 5px;
Expand Down
5 changes: 3 additions & 2 deletions Source/Widgets/Balloon/Balloon.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ define([
container = getElement(container);

this._container = container;
container.setAttribute('data-bind', 'css: { "cesium-balloon-wrapper-visible" : showBalloon, "cesium-balloon-wrapper-hidden" : !showBalloon }');
container.setAttribute('data-bind', 'css: { "cesium-balloon-container" : true, "cesium-balloon-container-visible" : showBalloon }');

var el = document.createElement('div');
this._element = el;
el.className = 'cesium-balloon-wrapper';
Expand All @@ -60,7 +61,7 @@ define([
var arrowContainer = document.createElement('div');
arrowContainer.className = 'cesium-balloon-arrow-container';
arrowContainer.setAttribute('data-bind', 'css: { "cesium-balloon-arrow-container-downup" : _down || _up, "cesium-balloon-arrow-container-leftright" : _left || _right,\
"cesium-balloon-arrow-show" : showArrow, "cesium-balloon-arrow-hide" : !showArrow},\
"cesium-balloon-arrow-container-show" : showArrow },\
style: { "bottom" : _arrowY, "left" : _arrowX}');
var arrow = document.createElement('div');
arrow.className = 'cesium-balloon-arrow';
Expand Down
4 changes: 2 additions & 2 deletions Source/Widgets/Balloon/BalloonViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ define([
*
* @type {Number}
*/
this._positionX = '0';
this._positionX = '-1000px';

/**
* The y screen position of the balloon.
Expand Down Expand Up @@ -202,7 +202,7 @@ define([
*
* @type {Boolean}
*/
this.showArrow = true;
this.showArrow = false;

/**
* True of the balloon arrow should be arrowing down.
Expand Down

0 comments on commit dcc7c46

Please sign in to comment.