Beispiel #1
0
    mixins: [Class],

    props: {
        selModal: String,
        selPanel: String,
    },

    data: {
        selModal: '.uk-modal',
        selPanel: '.uk-modal-dialog',
    },

    computed: {

        modal({selModal}, $el) {
            return closest($el, selModal);
        },

        panel({selPanel}, $el) {
            return closest($el, selPanel);
        }

    },

    connected() {
        css(this.$el, 'minHeight', 150);
    },

    update: {

        read() {
Beispiel #2
0
        const margin = toFloat(css(this.$el, this.marginProp));
        Transition.start(
            css(this.$el, this.startProps),
            {opacity: 1, [this.marginProp]: margin}
        ).then(() => {
            if (this.timeout) {
                this.timer = setTimeout(this.close, this.timeout);
            }
        });

    },

    events: {

        click(e) {
            if (closest(e.target, 'a[href="#"],a[href=""]')) {
                e.preventDefault();
            }
            this.close();
        },

        [pointerEnter]() {
            if (this.timer) {
                clearTimeout(this.timer);
            }
        },

        [pointerLeave]() {
            if (this.timeout) {
                this.timer = setTimeout(this.close, this.timeout);
            }