View | Details | Raw Unified | Return to bug 38899
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue (-1 / +29 lines)
Lines 1-5 Link Here
1
<template>
1
<template>
2
    <div id="toolbar" class="btn-toolbar">
2
    <div
3
        id="toolbar"
4
        :class="sticky ? 'btn-toolbar sticky' : 'btn-toolbar'"
5
        ref="toolbar"
6
    >
3
        <slot />
7
        <slot />
4
    </div>
8
    </div>
5
</template>
9
</template>
Lines 7-11 Link Here
7
<script>
11
<script>
8
export default {
12
export default {
9
    name: "Toolbar",
13
    name: "Toolbar",
14
    props: {
15
        sticky: {
16
            type: Boolean,
17
            default: false,
18
        },
19
    },
20
    data() {
21
        return {
22
            observer: null,
23
        };
24
    },
25
    methods: {
26
        stickyToolbar([e]) {
27
            e.target.classList.toggle("floating", e.intersectionRatio < 1);
28
        },
29
    },
30
    mounted() {
31
        if (this.sticky) {
32
            this.observer = new IntersectionObserver(this.stickyToolbar, {
33
                threshold: [1],
34
            });
35
            this.observer.observe(this.$refs.toolbar);
36
        }
37
    },
10
};
38
};
11
</script>
39
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue (-23 / +25 lines)
Lines 1-32 Link Here
1
<template>
1
<template>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="vendor_add">
3
    <template v-else>
4
        <h1 v-if="vendor.id">
4
        <h1 v-if="vendor.id">
5
            {{ $__("Edit vendor #%s").format(vendor.id) }}
5
            {{ $__("Edit vendor #%s").format(vendor.id) }}
6
        </h1>
6
        </h1>
7
        <h1 v-else>{{ $__("Add vendor") }}</h1>
7
        <h1 v-else>{{ $__("Add vendor") }}</h1>
8
        <div>
8
        <form @submit="onSubmit($event)" id="add_vendor">
9
            <form @submit="onSubmit($event)">
9
            <Toolbar :sticky="true">
10
                <VendorDetails :vendor="vendor" />
10
                <ButtonSubmit :text="$__('Save')" />
11
                <VendorContacts :vendor="vendor" />
11
                <ToolbarButton
12
                <VendorInterfaces :vendor="vendor" />
12
                    :to="{ name: 'VendorList' }"
13
                <VendorOrderingInformation
13
                    :title="$__('Cancel')"
14
                    :vendor="vendor"
14
                    icon="times"
15
                    :verifyDiscountValue="verifyDiscountValue"
15
                >
16
                    :discountValid="discountValid"
16
                </ToolbarButton>
17
                />
17
            </Toolbar>
18
                <fieldset class="action">
18
            <VendorDetails :vendor="vendor" />
19
                    <ButtonSubmit />
19
            <VendorContacts :vendor="vendor" />
20
                    <router-link
20
            <VendorInterfaces :vendor="vendor" />
21
                        :to="{ name: 'VendorList' }"
21
            <VendorOrderingInformation
22
                        role="button"
22
                :vendor="vendor"
23
                        class="cancel"
23
                :verifyDiscountValue="verifyDiscountValue"
24
                        >{{ $__("Cancel") }}</router-link
24
                :discountValid="discountValid"
25
                    >
25
            />
26
                </fieldset>
26
        </form>
27
            </form>
27
    </template>
28
        </div>
29
    </div>
30
</template>
28
</template>
31
29
32
<script>
30
<script>
Lines 37-42 import VendorDetails from "./VendorDetails.vue"; Link Here
37
import VendorContacts from "./VendorContacts.vue";
35
import VendorContacts from "./VendorContacts.vue";
38
import VendorOrderingInformation from "./VendorOrderingInformation.vue";
36
import VendorOrderingInformation from "./VendorOrderingInformation.vue";
39
import VendorInterfaces from "./VendorInterfaces.vue";
37
import VendorInterfaces from "./VendorInterfaces.vue";
38
import Toolbar from "../Toolbar.vue";
39
import ToolbarButton from "../ToolbarButton.vue";
40
40
41
export default {
41
export default {
42
    data() {
42
    data() {
Lines 193-198 export default { Link Here
193
        VendorContacts,
193
        VendorContacts,
194
        VendorOrderingInformation,
194
        VendorOrderingInformation,
195
        VendorInterfaces,
195
        VendorInterfaces,
196
        Toolbar,
197
        ToolbarButton,
196
    },
198
    },
197
    name: "VendorFormAdd",
199
    name: "VendorFormAdd",
198
};
200
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/acquisitions.ts (-2 / +3 lines)
Lines 12-17 import { Link Here
12
    faPlus,
12
    faPlus,
13
    faSpinner,
13
    faSpinner,
14
    faTrash,
14
    faTrash,
15
    faTimes,
15
} from "@fortawesome/free-solid-svg-icons";
16
} from "@fortawesome/free-solid-svg-icons";
16
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
17
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
17
import vSelect from "vue-select";
18
import vSelect from "vue-select";
Lines 24-30 library.add( Link Here
24
    faPencil,
25
    faPencil,
25
    faPlus,
26
    faPlus,
26
    faSpinner,
27
    faSpinner,
27
    faTrash
28
    faTrash,
29
    faTimes
28
);
30
);
29
31
30
import App from "../components/Vendors/Main.vue";
32
import App from "../components/Vendors/Main.vue";
31
- 

Return to bug 38899