[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}"> ng-class="{inactive: !paneModel.leftPane}">
</mct-splitter> </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}'> ng-class='{leftInactive: !paneModel.leftPane}'>
<mct-split-pane class='contents abs' <mct-split-pane class='contents abs'
anchor='right'> anchor='right'>
<div class='split-pane-component items pane' <div class='split-pane-component items pane slide'
ng-class='{rightInactive: !paneModel.rightPane}'> ng-class='{rightInactive: !paneModel.rightPane}'>
<div class='holder abs' <div class='holder abs'
id='content-area'> id='content-area'>

View File

@ -5161,22 +5161,22 @@ input[type="text"] {
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
/* line 30, ../sass/tree/_pane.scss */ /* line 31, ../sass/tree/_pane.scss */
.pane.left.inactive { .pane.left.inactive {
width: 0 !important; width: 0 !important;
min-width: 0 !important; } min-width: 0 !important; }
/* line 35, ../sass/tree/_pane.scss */ /* line 36, ../sass/tree/_pane.scss */
.pane.left.inactive .tree-holder { .pane.left.inactive .tree-holder {
padding-right: 0; } padding-right: 0; }
/* line 40, ../sass/tree/_pane.scss */ /* line 41, ../sass/tree/_pane.scss */
.pane.left.inactive .search-holder { .pane.left.inactive .search-holder {
display: none; } display: none; }
/* line 46, ../sass/tree/_pane.scss */ /* line 47, ../sass/tree/_pane.scss */
.pane.left .create-btn.major { .pane.left .create-btn.major {
top: 0; top: 0;
left: 0; left: 0;
transition: all 0.35s; } transition: all 0.35s; }
/* line 51, ../sass/tree/_pane.scss */ /* line 52, ../sass/tree/_pane.scss */
.pane.left .create-btn.major.inactivePane { .pane.left .create-btn.major.inactivePane {
top: 0; top: 0;
left: 0; left: 0;
@ -5189,45 +5189,43 @@ input[type="text"] {
line-height: 14px; line-height: 14px;
left: -11px; left: -11px;
top: 20px; } top: 20px; }
/* line 69, ../sass/tree/_pane.scss */ /* line 70, ../sass/tree/_pane.scss */
.pane.left .create-btn.major.inactivePane span { .pane.left .create-btn.major.inactivePane span {
display: none; } display: none; }
/* line 77, ../sass/tree/_pane.scss */ /* line 78, ../sass/tree/_pane.scss */
.splitter-bar.splitter { .splitter-bar.splitter {
opacity: 1; opacity: 1;
transition: opacity 0.35s, visibility 0.35s; transition: opacity 0.35s, visibility 0.35s;
top: 0; } top: 0; }
/* line 84, ../sass/tree/_pane.scss */ /* line 85, ../sass/tree/_pane.scss */
.splitter-bar.splitter.inactive { .splitter-bar.splitter.inactive {
visibility: hidden; visibility: hidden;
opacity: 0; } opacity: 0; }
/* line 88, ../sass/tree/_pane.scss */ /* line 89, ../sass/tree/_pane.scss */
.splitter-bar.splitter.inactive:before { .splitter-bar.splitter.inactive:before {
border-width: 0; } border-width: 0; }
/* line 96, ../sass/tree/_pane.scss */ /* line 97, ../sass/tree/_pane.scss */
.splitter-bar.left.splitter.inactive { .splitter-bar.left.splitter.inactive {
transition: opacity 0s, visibility 0s; } transition: opacity 0s, visibility 0s; }
/* line 102, ../sass/tree/_pane.scss */ /* line 106, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right { .split-pane-component.secondary-split.pane.right.leftInactive {
transition: left 0.35s;
transition-timing-function: ease-out; }
/* line 107, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right.leftInactive {
left: 0 !important; } left: 0 !important; }
/* line 111, ../sass/tree/_pane.scss */ /* line 109, ../sass/tree/_pane.scss */
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane { .split-pane-component.secondary-split.pane.right.slide {
transition: right 0.35s; transition: left 0.35s; }
transition-timing-function: ease-out; } /* line 116, ../sass/tree/_pane.scss */
/* line 116, ../sass/tree/_pane.scss */ .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane.rightInactive {
.split-pane-component.secondary-split.pane.right .split-pane-component.items.pane.rightInactive {
right: 0 !important; } 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 .object-browse-bar { .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; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
@ -5238,81 +5236,81 @@ input[type="text"] {
line-height: 16px; line-height: 16px;
font-size: 10px; font-size: 10px;
text-align: center; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left {
left: -12px; left: -12px;
top: 3px; top: 3px;
border-top-right-radius: 2px; border-top-right-radius: 2px;
border-bottom-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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.inactivePane {
left: -15px; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.inactivePane:after {
content: 'F'; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.left.activePane:after {
content: '<'; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right {
float: right; float: right;
right: -9px; right: -9px;
top: -13px; top: -13px;
border-top-left-radius: 2px; border-top-left-radius: 2px;
border-bottom-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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.inactivePane {
right: -12px; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.inactivePane:after {
content: 'G'; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .pane-tabs.right.activePane:after {
content: '>'; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .items-select {
margin-left: 10px; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.items.pane .object-browse-bar .btn-bar.right {
margin-right: 10px; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right {
min-width: 150px; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right.inactive {
min-width: 0 !important; min-width: 0 !important;
width: 0 !important; width: 0 !important;
visibility: hidden; visibility: hidden;
opacity: 0; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder .info-icon {
color: #0099cc; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li {
font-size: 0.9em; font-size: 0.9em;
padding: 2px 0px; padding: 2px 0px;
margin: 2px 0px; margin: 2px 0px;
border-top: solid 1px grey; } 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 { .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; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li em {
font-weight: bold; font-weight: bold;
line-height: 1.25em; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li em:after {
content: '\A'; content: '\A';
white-space: pre; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location {
display: inline-block; display: inline-block;
max-width: 100%; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location .label {
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
@ -5324,13 +5322,13 @@ input[type="text"] {
max-width: 100%; max-width: 100%;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; } 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 { .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; } 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 { .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; } 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 { .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; color: #49dedb;
font-size: 6px; font-size: 6px;
@ -5338,7 +5336,7 @@ input[type="text"] {
margin-right: 9px; margin-right: 9px;
text-shadow: black 0 1px 2px; text-shadow: black 0 1px 2px;
z-index: 2; } 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 { .split-pane-component.secondary-split.pane.right .split-pane-component.object-inspector.pane.right .holder.inspector-holder ul li .inspector-location:after {
content: '>'; content: '>';
font-family: symbolsfont; font-family: symbolsfont;
@ -5346,7 +5344,7 @@ input[type="text"] {
position: relative; position: relative;
top: -8px; top: -8px;
left: -4px; } 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 { .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: ''; content: '';
display: inline-block; } display: inline-block; }

View File

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

View File

@ -29,7 +29,8 @@ define(
// Pixel width to allocate for the splitter itself // Pixel width to allocate for the splitter itself
var SPLITTER_TEMPLATE = "<div class='abs'" + var SPLITTER_TEMPLATE = "<div class='abs'" +
"mct-drag-down=\"splitter.startMove()\" " + "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 = { OFFSETS_BY_EDGE = {
left: "offsetLeft", left: "offsetLeft",
right: "offsetRight", right: "offsetRight",
@ -44,7 +45,8 @@ define(
*/ */
function MCTSplitter() { function MCTSplitter() {
function link(scope, element, attrs, mctSplitPane) { function link(scope, element, attrs, mctSplitPane) {
var initialPosition; var initialPosition,
slideElement;
element.addClass("splitter"); element.addClass("splitter");
@ -55,8 +57,24 @@ define(
scope.splitter = { scope.splitter = {
// Begin moving this splitter // Begin moving this splitter
startMove: function () { startMove: function () {
var splitter = element[0]; var splitter = element[0],
children = element.parent().children(),
i, j;
// Set initial position
initialPosition = mctSplitPane.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 // Handle user changes to splitter position
move: function (delta) { move: function (delta) {
@ -67,6 +85,10 @@ define(
// Update the position of this splitter // Update the position of this splitter
mctSplitPane.position(initialPosition + pixelDelta); mctSplitPane.position(initialPosition + pixelDelta);
},
// Replace sliding class
endMove: function () {
slideElement.classList.add('slide');
} }
}; };
} }