[Inspector] Splitter drag temporarily removes transition

Dragging mct-splitter will remove a 'slide'
class from the splitter's sibling while a
drag is in process, and then replace the
'slide' class. This allows the left and right
panes to have slide transitions for open/close,
but not when the splitter is being dragged. #73.
This commit is contained in:
slhale 2015-08-26 10:22:14 -07:00
parent 86d398d8ff
commit 7119f6f3a1
4 changed files with 182 additions and 159 deletions

View File

@ -60,12 +60,12 @@
ng-class="{inactive: !paneModel.leftPane}">
</mct-splitter>
<div class='split-pane-component secondary-split pane right'
<div class='split-pane-component secondary-split pane right slide'
ng-class='{leftInactive: !paneModel.leftPane}'>
<mct-split-pane class='contents abs'
anchor='right'>
<div class='split-pane-component items pane'
<div class='split-pane-component items pane slide'
ng-class='{rightInactive: !paneModel.rightPane}'>
<div class='holder abs'
id='content-area'>

View File

@ -5161,22 +5161,22 @@ input[type="text"] {
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/* line 30, ../sass/tree/_pane.scss */
/* line 31, ../sass/tree/_pane.scss */
.pane.left.inactive {
width: 0 !important;
min-width: 0 !important; }
/* line 35, ../sass/tree/_pane.scss */
/* line 36, ../sass/tree/_pane.scss */
.pane.left.inactive .tree-holder {
padding-right: 0; }
/* line 40, ../sass/tree/_pane.scss */
/* line 41, ../sass/tree/_pane.scss */
.pane.left.inactive .search-holder {
display: none; }
/* line 46, ../sass/tree/_pane.scss */
/* line 47, ../sass/tree/_pane.scss */
.pane.left .create-btn.major {
top: 0;
left: 0;
transition: all 0.35s; }
/* line 51, ../sass/tree/_pane.scss */
/* line 52, ../sass/tree/_pane.scss */
.pane.left .create-btn.major.inactivePane {
top: 0;
left: 0;
@ -5189,45 +5189,43 @@ input[type="text"] {
line-height: 14px;
left: -11px;
top: 20px; }
/* line 69, ../sass/tree/_pane.scss */
/* line 70, ../sass/tree/_pane.scss */
.pane.left .create-btn.major.inactivePane span {
display: none; }
/* line 77, ../sass/tree/_pane.scss */
/* line 78, ../sass/tree/_pane.scss */
.splitter-bar.splitter {
opacity: 1;
transition: opacity 0.35s, visibility 0.35s;
top: 0; }
/* line 84, ../sass/tree/_pane.scss */
/* line 85, ../sass/tree/_pane.scss */
.splitter-bar.splitter.inactive {
visibility: hidden;
opacity: 0; }
/* line 88, ../sass/tree/_pane.scss */
/* line 89, ../sass/tree/_pane.scss */
.splitter-bar.splitter.inactive:before {
border-width: 0; }
/* line 96, ../sass/tree/_pane.scss */
/* line 97, ../sass/tree/_pane.scss */
.splitter-bar.left.splitter.inactive {
transition: opacity 0s, visibility 0s; }
/* line 102, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right {
transition: left 0.35s;
transition-timing-function: ease-out; }
/* line 107, ../sass/tree/_pane.scss */
/* line 106, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right.leftInactive {
left: 0 !important; }
/* line 111, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane {
transition: right 0.35s;
transition-timing-function: ease-out; }
/* line 109, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right.slide {
transition: left 0.35s; }
/* line 116, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane.rightInactive {
right: 0 !important; }
/* line 121, ../sass/tree/_pane.scss */
/* line 119, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane.slide {
transition: right 0.35s; }
/* line 124, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar {
position: relative; }
/* line 124, ../sass/tree/_pane.scss */
/* line 127, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs {
position: relative;
cursor: pointer;
@ -5238,81 +5236,81 @@ input[type="text"] {
line-height: 16px;
font-size: 10px;
text-align: center; }
/* line 138, ../sass/tree/_pane.scss */
/* line 141, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left {
left: -12px;
top: 3px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px; }
/* line 146, ../sass/tree/_pane.scss */
/* line 149, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.inactivePane {
left: -15px; }
/* line 148, ../sass/tree/_pane.scss */
/* line 151, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.inactivePane:after {
content: 'F'; }
/* line 152, ../sass/tree/_pane.scss */
/* line 155, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.activePane:after {
content: '<'; }
/* line 158, ../sass/tree/_pane.scss */
/* line 161, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right {
float: right;
right: -9px;
top: -13px;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px; }
/* line 167, ../sass/tree/_pane.scss */
/* line 170, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.inactivePane {
right: -12px; }
/* line 169, ../sass/tree/_pane.scss */
/* line 172, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.inactivePane:after {
content: 'G'; }
/* line 173, ../sass/tree/_pane.scss */
/* line 176, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.activePane:after {
content: '>'; }
/* line 181, ../sass/tree/_pane.scss */
/* line 184, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .items-select {
margin-left: 10px; }
/* line 185, ../sass/tree/_pane.scss */
/* line 188, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .btn-bar.right {
margin-right: 10px; }
/* line 191, ../sass/tree/_pane.scss */
/* line 194, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right {
min-width: 150px; }
/* line 195, ../sass/tree/_pane.scss */
/* line 198, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right.inactive {
min-width: 0 !important;
width: 0 !important;
visibility: hidden;
opacity: 0; }
/* line 202, ../sass/tree/_pane.scss */
/* line 205, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder {
overflow-y: auto;
overflow-x: hidden; }
/* line 206, ../sass/tree/_pane.scss */
/* line 209, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder .info-icon {
color: #0099cc; }
/* line 210, ../sass/tree/_pane.scss */
/* line 213, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li {
font-size: 0.9em;
padding: 2px 0px;
margin: 2px 0px;
border-top: solid 1px grey; }
/* line 217, ../sass/tree/_pane.scss */
/* line 220, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li:first-child {
border-top-width: 0px; }
/* line 222, ../sass/tree/_pane.scss */
/* line 225, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li em {
font-weight: bold;
line-height: 1.25em; }
/* line 226, ../sass/tree/_pane.scss */
/* line 229, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li em:after {
content: '\A';
white-space: pre; }
/* line 233, ../sass/tree/_pane.scss */
/* line 236, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location {
display: inline-block;
max-width: 100%; }
/* line 237, ../sass/tree/_pane.scss */
/* line 240, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location .label {
cursor: pointer;
display: inline-block;
@ -5324,13 +5322,13 @@ input[type="text"] {
max-width: 100%;
text-overflow: ellipsis;
overflow-x: hidden; }
/* line 244, ../sass/tree/_pane.scss */
/* line 247, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location .label:hover {
background-color: #404040; }
/* line 258, ../sass/tree/_pane.scss */
/* line 261, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location .label .icon.type-icon {
font-size: 14px; }
/* line 261, ../sass/tree/_pane.scss */
/* line 264, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location .label .icon.type-icon .l-icon-link {
color: #49dedb;
font-size: 6px;
@ -5338,7 +5336,7 @@ input[type="text"] {
margin-right: 9px;
text-shadow: black 0 1px 2px;
z-index: 2; }
/* line 275, ../sass/tree/_pane.scss */
/* line 278, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location:after {
content: '>';
font-family: symbolsfont;
@ -5346,7 +5344,7 @@ input[type="text"] {
position: relative;
top: -8px;
left: -4px; }
/* line 285, ../sass/tree/_pane.scss */
/* line 288, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location:last-child:after {
content: '';
display: inline-block; }

View File

@ -24,6 +24,7 @@
$transitionTime: 0.35s; // For the left menu open/close
// Set the left pane (which contains the tree) to have no width to close
// (not display:none because we still need to have access to the create button)
.pane.left {
@ -102,20 +103,22 @@ $transitionTime: 0.35s; // For the left menu open/close
.split-pane-component.secondary-split.pane.right {
// Sliding transition for open/close of left pane
transition: left $transitionTime;
transition-timing-function: ease-out;
&.leftInactive {
left: 0 !important;
}
&.slide {
transition: left $transitionTime;
}
.split-pane-component.items.pane {
// Sliding transition for open/close of right pane
transition: right $transitionTime;
transition-timing-function: ease-out;
&.rightInactive {
right: 0 !important;
}
&.slide {
transition: right $transitionTime;
}
// Tab buttons close to the splitter bars
.object-browse-bar {

View File

@ -29,7 +29,8 @@ define(
// Pixel width to allocate for the splitter itself
var SPLITTER_TEMPLATE = "<div class='abs'" +
"mct-drag-down=\"splitter.startMove()\" " +
"mct-drag=\"splitter.move(delta)\"></div>",
"mct-drag=\"splitter.move(delta)\" " +
"mct-drag-up=\"splitter.endMove()\"></div>",
OFFSETS_BY_EDGE = {
left: "offsetLeft",
right: "offsetRight",
@ -44,7 +45,8 @@ define(
*/
function MCTSplitter() {
function link(scope, element, attrs, mctSplitPane) {
var initialPosition;
var initialPosition,
slideElement;
element.addClass("splitter");
@ -55,8 +57,24 @@ define(
scope.splitter = {
// Begin moving this splitter
startMove: function () {
var splitter = element[0];
var splitter = element[0],
children = element.parent().children(),
i, j;
// Set initial position
initialPosition = mctSplitPane.position();
// Remove sliding class from sibling element so no delay in pane movement
for (i = 0; i < children.length; i += 1) {
for (j = 0; j < children[i].classList.length; j += 1) {
if (children[i].classList[j] === 'slide') {
// Store the element that had the sliding class so
// we can replace it later
slideElement = children[i];
children[i].classList.remove('slide');
}
}
}
},
// Handle user changes to splitter position
move: function (delta) {
@ -67,6 +85,10 @@ define(
// Update the position of this splitter
mctSplitPane.position(initialPosition + pixelDelta);
},
// Replace sliding class
endMove: function () {
slideElement.classList.add('slide');
}
};
}