mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 23:12:23 +00:00
[Swimlanes] Check for valid swimlane
Issue #599. Also switches class toggle from scope based to element based.
This commit is contained in:
parent
6c5d5f3d00
commit
471adde923
@ -77,7 +77,8 @@
|
|||||||
<mct-splitter></mct-splitter>
|
<mct-splitter></mct-splitter>
|
||||||
|
|
||||||
<!-- BOTTOM PANE RESOURCE LEGEND -->
|
<!-- BOTTOM PANE RESOURCE LEGEND -->
|
||||||
<div mct-resource-graph-drop class="split-pane-component abs l-timeline-pane t-pane-h l-pane-btm s-timeline-resource-legend l-timeline-resource-legend" ng-class="{'drop-over': resourceGraphLegendropOver }">
|
<div mct-resource-graph-drop
|
||||||
|
class="split-pane-component abs l-timeline-pane t-pane-h l-pane-btm s-timeline-resource-legend l-timeline-resource-legend">
|
||||||
<div class="l-title s-title">{{ngModel.title}}Resource Graph Legend</div>
|
<div class="l-title s-title">{{ngModel.title}}Resource Graph Legend</div>
|
||||||
<div class="l-legend-items legend">
|
<div class="l-legend-items legend">
|
||||||
<mct-include key="'timeline-legend-item'"
|
<mct-include key="'timeline-legend-item'"
|
||||||
|
@ -36,8 +36,15 @@ define(
|
|||||||
function link(scope, element, attrs) {
|
function link(scope, element, attrs) {
|
||||||
// Handle dragover
|
// Handle dragover
|
||||||
element.on('dragover', function (e) {
|
element.on('dragover', function (e) {
|
||||||
scope.resourceGraphLegendropOver = true;
|
var swimlane = dndService.getData(
|
||||||
|
SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (typeof swimlane !== "undefined" && !swimlane.graph()) {
|
||||||
|
element.addClass('drop-over');
|
||||||
scope.$apply();
|
scope.$apply();
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// Handle drops
|
// Handle drops
|
||||||
element.on('drop', function (e) {
|
element.on('drop', function (e) {
|
||||||
@ -45,15 +52,19 @@ define(
|
|||||||
SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
|
SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
element.removeClass('drop-over');
|
||||||
|
|
||||||
// Only toggle if the graph isn't already set
|
// Only toggle if the graph isn't already set
|
||||||
if (!swimlane.graph()) {
|
if (typeof swimlane !== "undefined" && !swimlane.graph()) {
|
||||||
swimlane.toggleGraph();
|
swimlane.toggleGraph();
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Clear highlights when drag leaves this swimlane
|
// Clear highlights when drag leaves this swimlane
|
||||||
element.on('dragleave', function () {
|
element.on('dragleave', function (e) {
|
||||||
scope.resourceGraphLegendropOver = false;
|
element.removeClass('drop-over');
|
||||||
scope.$apply();
|
scope.$apply();
|
||||||
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user