From 7e0f475c63b17c9450c67694f1b40094f9b34bfb Mon Sep 17 00:00:00 2001 From: Joel McKinnon Date: Thu, 23 Jan 2020 16:13:28 -0800 Subject: [PATCH] style changes for dnd --- .../components/ConditionCollection.vue | 7 +- .../condition/components/ConditionEdit.vue | 48 ++++++++--- src/plugins/condition/components/DropHint.vue | 83 +++++++++++++++++++ .../condition/components/condition.scss | 8 +- 4 files changed, 123 insertions(+), 23 deletions(-) create mode 100644 src/plugins/condition/components/DropHint.vue diff --git a/src/plugins/condition/components/ConditionCollection.vue b/src/plugins/condition/components/ConditionCollection.vue index 08e69280fe..8a5abe63df 100644 --- a/src/plugins/condition/components/ConditionCollection.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -33,13 +33,9 @@ class="c-c__drag-ghost" >
-
-
-
-
-
-
-
-
+
+
-
    +
    • @@ -62,16 +63,16 @@
    -
      +
      • @@ -82,7 +83,7 @@
      -
        +
        • @@ -120,7 +121,7 @@ @@ -152,7 +153,7 @@ export default { type: Object, required: true }, - }, + }, data() { return { condition: this.condition, @@ -198,6 +199,8 @@ export default { this.conditionClass = new ConditionClass(this.condition, this.openmct); this.conditionClass.on('conditionResultUpdated', this.handleConditionResult.bind(this)); })); + + this.dragGhost = document.getElementById('js-c-drag-ghost'); }, updated() { if (this.isCurrent && this.isCurrent.key === this.condition.key) { @@ -206,6 +209,25 @@ export default { this.persist(); }, methods: { + initDrag() { + // let type = this.openmct.types.get(this.domainObject.type), + // iconClass = type.definition ? type.definition.cssClass : 'icon-object-unknown'; + + // if (this.dragGhost) { + // let originalClassName = this.dragGhost.classList[0]; + // this.dragGhost.className = ''; + // this.dragGhost.classList.add(originalClassName, iconClass); + + // this.dragGhost.innerHTML = `${this.domainObject.name}`; + // event.dataTransfer.setDragImage(this.dragGhost, 0, 0); + // } + + console.log('conditionId', this.condition.id); + console.log('containerIndex', this.containerIndex); + + event.dataTransfer.setData('conditionId', this.condition.id); + event.dataTransfer.setData('containerIndex', this.containerIndex); + }, handleConditionResult(args) { // console.log('ConditionEdit::Result', args); this.$emit('condition-result-updated', { diff --git a/src/plugins/condition/components/DropHint.vue b/src/plugins/condition/components/DropHint.vue new file mode 100644 index 0000000000..d2a6dc61b0 --- /dev/null +++ b/src/plugins/condition/components/DropHint.vue @@ -0,0 +1,83 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2018, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + + + + diff --git a/src/plugins/condition/components/condition.scss b/src/plugins/condition/components/condition.scss index 160ab59286..4e7b573658 100644 --- a/src/plugins/condition/components/condition.scss +++ b/src/plugins/condition/components/condition.scss @@ -1,5 +1,3 @@ - - .widget-condition { background-color: #eee; margin: 0 0 0.6em; @@ -53,7 +51,7 @@ margin-left: 0; } -.l-widget-rule { +.l-widget-condition { padding: 0; } @@ -61,11 +59,11 @@ padding: 0; } -.widget-rule-content.expanded { +.widget-condition-content.expanded { margin: 0 3px; } -.widget-rule-content.expanded ul { +.widget-condition-content.expanded ul { border-top: solid 1px #ccc; padding: 2px; }