Commit eca8dc31 authored by jdurrant's avatar jdurrant
Browse files

Restored checkmark component.

parent 9ea3929d
// This file is part of BINANA, released under the Apache 2.0 License. See
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2021 Jacob D. Durrant.
declare var Vue;
/** An object containing the vue-component computed functions. */
let computedFunctions = {};
/** An object containing the vue-component methods functions. */
let methodsFunctions = {};
/** An object containing the vue-component watch functions. */
let watchFunctions = {}
/**
* The vue-component mounted function.
* @returns void
*/
function mountedFunction(): void {}
/**
* Setup the check-mark Vue commponent.
* @returns void
*/
export function setup(): void {
Vue.component("check-mark", {
/**
* Get the data associated with this component.
* @returns any The data.
*/
"data"(): any {
return {};
},
"methods": methodsFunctions,
"template": /* html */ `
<span>
<div class="spacer25px" v-if="value">✔️</div>
<div class="spacer25px" v-else></div>
<slot></slot>
<div class="spacer25px"></div>
</span>
`,
"props": {
"value": Boolean,
},
"computed": computedFunctions,
/**
* Runs when the vue component is mounted.
* @returns void
*/
"mounted": mountedFunction,
"watch": watchFunctions
});
}
......@@ -32,16 +32,16 @@ let computedFunctions = {
// },
/**
* Gets the text too use on the bond-visible buttton.
* DEPRECIATED. Gets the text too use on the bond-visible buttton.
* @returns string The text to use.
*/
"bondVisBtnTxt"(): string {
if (this.$store.state["bondVisible"]) {
return "Interactions";
} else {
return "<span style='text-decoration: line-through;'>Interactions</span>";
}
},
// "bondVisBtnTxt"(): string {
// if (this.$store.state["bondVisible"]) {
// return "Interactions";
// } else {
// return "<span style='text-decoration: line-through;'>Interactions</span>";
// }
// },
interactionVisibilityStatus: {
get(): string {
......@@ -208,42 +208,42 @@ let methodsFunctions = {
},
/**
* Fires when the user indicates s/he would like to change the color
* scheme.
* DEPRECIATED. Fires when the user indicates s/he would like to change the
* color scheme.
* @returns void
*/
"onChangeColor"(): void {
let newVal = undefined;
switch (this.$store.state["colorByInteraction"]) {
case Store.InteractionColoring.MOLECULE:
newVal = Store.InteractionColoring.INTERACTION;
break;
case Store.InteractionColoring.INTERACTION:
newVal = Store.InteractionColoring.NONE;
// If none, make sure bonds are visible.
this.$store.commit("setVar", {
name: "bondVisible",
val: true
});
// "onChangeColor"(): void {
// let newVal = undefined;
// switch (this.$store.state["colorByInteraction"]) {
// case Store.InteractionColoring.MOLECULE:
// newVal = Store.InteractionColoring.INTERACTION;
// break;
// case Store.InteractionColoring.INTERACTION:
// newVal = Store.InteractionColoring.NONE;
break;
case Store.InteractionColoring.NONE:
newVal = Store.InteractionColoring.MOLECULE;
break;
}
// // If none, make sure bonds are visible.
// this.$store.commit("setVar", {
// name: "bondVisible",
// val: true
// });
this.$store.commit("setVar", {
name: "colorByInteraction",
val: newVal
});
// break;
// case Store.InteractionColoring.NONE:
// newVal = Store.InteractionColoring.MOLECULE;
// break;
// }
this["updateHighlight"]();
},
// this.$store.commit("setVar", {
// name: "colorByInteraction",
// val: newVal
// });
// this["updateHighlight"]();
// },
/**
* Runs when the bond-visibility button is pressed. DEPRECIATED, but
* keep commented out in case you bring it back in the future.
* Runs when the bond-visibility button is pressed. DEPRECIATED, but keep
* commented out in case you bring it back in the future.
* @returns void
*/
// "onBondVisChange"(): void {
......@@ -458,9 +458,7 @@ let methodsFunctions = {
* The vue-component mounted function.
* @returns void
*/
function mountedFunction(): void {
this["webAssemblyAvaialble"] = Utils.webAssemblySupported();
}
function mountedFunction(): void {}
/**
* Setup the binana-params Vue commponent.
......@@ -844,7 +842,6 @@ export function setup(): void {
"data"() {
return {
"showFileInputs": true,
"webAssemblyAvaialble": true,
lastInteractionNameUsed: undefined,
"forceLigandFileName": null,
"nonProteinResidues": ""
......
......@@ -11,6 +11,7 @@ import * as ThreeDMol from "../UI/ThreeDMol";
import * as OpenModal from "../UI/Modal/OpenModal";
import * as SubSection from "../UI/SubSection";
import * as FormButton from "../UI/Forms/FormButton";
import * as CheckMark from "../UI/CheckMark";
import { setupMolLoader } from "../UI/FileLoaderSystem/MolLoader.Vue";
declare var Vue;
......@@ -25,6 +26,7 @@ export function setup(): void {
Vue.use(BootstrapVue)
Vue.use(Vuex)
CheckMark.setup();
SubSection.setup();
FormButton.setup();
OpenModal.setup();
......
......@@ -132,38 +132,38 @@ export const store = new Vuex.Store({
},
/**
* Set one of the binana parameters.
* DEPRECIATED. Set one of the binana parameters.
* @param {*} state The VueX state.
* @param {iVueXParam} payload An object with information about
* which binana parameter to set.
* @param {iVueXParam} payload An object with information about which
* binana parameter to set.
* @returns void
*/
"setBinanaParam"(state: any, payload: iVueXParam): void {
// By redefining the whole variable, it becomes reactive. Directly
// changing individual properties is not reactive.
state["binanaParams"] = Utils.getNewObjWithUpdate(
state["binanaParams"],
payload.name,
payload.val
);
},
// "setBinanaParam"(state: any, payload: iVueXParam): void {
// // By redefining the whole variable, it becomes reactive. Directly
// // changing individual properties is not reactive.
// state["binanaParams"] = Utils.getNewObjWithUpdate(
// state["binanaParams"],
// payload.name,
// payload.val
// );
// },
/**
* Set a validation parameter (either validates or doesn't).
* DEPRECIATED. Set a validation parameter (either validates or doesn't).
* @param {*} state The VueX state.
* @param {iVueXParam} payload An object containing information
* about what to set.
* @returns void
*/
"setValidationParam"(state: any, payload: iVueXParam): void {
// By redefining the whole variable, it becomes reactive. Directly
// changing individual properties is not reactive.
state["validation"] = Utils.getNewObjWithUpdate(
state["validation"],
payload.name,
payload.val
);
},
// "setValidationParam"(state: any, payload: iVueXParam): void {
// // By redefining the whole variable, it becomes reactive. Directly
// // changing individual properties is not reactive.
// state["validation"] = Utils.getNewObjWithUpdate(
// state["validation"],
// payload.name,
// payload.val
// );
// },
/**
* Open the modal.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment