Skip to content

Commit

Permalink
Replace v-tooltip with bootstrap tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
fracz committed Nov 17, 2022
1 parent 1990dce commit 2dc856b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 62 deletions.
65 changes: 6 additions & 59 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"pnotify": "3.2.1",
"spectrum-colorpicker": "1.8.0",
"v-media-query": "^1.0.3",
"v-tooltip": "^2.1.3",
"vivus": "0.4.4",
"vue": "^2.7.13",
"vue-carousel": "0.6.5",
Expand Down
18 changes: 18 additions & 0 deletions src/frontend/src/common/common-directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ Vue.directive('focus', {
}
}
});

function insertTooltip(element, binding) {
if (binding.value) {
const placement = binding.modifiers.bottom ? 'bottom' : 'top';
$(element).tooltip({
title: binding.value,
placement,
});
} else {
$(element).tooltip('destroy');
}
}

Vue.directive('tooltip', {
inserted: insertTooltip,
update: insertTooltip,
componentUpdated: insertTooltip,
})
3 changes: 1 addition & 2 deletions src/frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'bootstrap/js/collapse';
import 'bootstrap/js/dropdown';
import 'bootstrap/js/tooltip';
import "pixeden-stroke-7-icon/pe-icon-7-stroke/dist/pe-icon-7-stroke.min.css";
import "bootstrap/dist/css/bootstrap.min.css";
import Vue from "vue";
import {i18n, setGuiLocale} from './locale';
import router from './router';
import VueResource from "vue-resource";
import vMediaQuery from 'v-media-query';
import VTooltip from 'v-tooltip';
import ResponseErrorInterceptor from "./common/http/response-error-interceptor";
import * as requestTransformers from "./common/http/transformers";
import "./common/common-components";
Expand All @@ -24,7 +24,6 @@ import './hello';

Vue.use(VueResource);
Vue.use(vMediaQuery, {variables: {xs: 768}});
Vue.use(VTooltip);

Vue.prototype.$frontendVersion = FRONTEND_VERSION; // eslint-disable-line no-undef
Vue.config.productionTip = false;
Expand Down

0 comments on commit 2dc856b

Please sign in to comment.